Questions about API methods that add or modify content on Stack Exchange sites. These methods must be invoked via HTTP POST.
This tag is for questions about API methods that add or modify content on Stack Exchange sites ("write methods").
This tag is not for any old question involving modification of something on SE's side. Creation of filters and working with access tokens are not appropriate for this tag - use filter or authentication instead.
Important: Write methods will fail if you access them via HTTP GET
! You must POST
to these methods, including parameters in the POST
body instead of the query string.
Caveats
- Any quality check failure on a question or answer will cause it not to be posted (the request will fail). This includes some circumstances where posting from the site would not fail (e.g. Stack Overflow's "This question appears subjective").
- Suggested edits don't work. At all. You need full edit privileges to use post edit methods (unless they're your posts).
- Voting to delete is not yet possible; deletion only works on your own posts.
Existing write methods
Questions
- Post:
/questions/add
- Edit:
/questions/{id}/edit
- Favorite ("star"):
/questions/{id}/favorite
/questions/{id}/favorite/undo
to undo
- Upvote:
/questions/{id}/upvote
/questions/{id}/upvote/undo
to undo
- Downvote:
/questions/{id}/downvote
/questions/{id}/downvote/undo
to undo
- Delete:
/questions/{id}/delete
- Flag (or vote to close):
/questions/{id}/flags/add
/questions/{id}/flags/options
to list available flags and vote options/questions/{id}/close/options
to list available vote options
Answers
- Post:
/questions/{id}/answers/add
- Edit:
/answers/{id}/edit
- Upvote:
/answers/{id}/upvote
/answers/{id}/upvote/undo
to undo
- Downvote:
/answers/{id}/downvote
/answers/{id}/downvote/undo
to undo
- Accept:
/answers/{id}/accept
/answers/{id}/accept/undo
to undo
- Delete:
/answers/{id}/delete
- Flag:
/answers/{id}/flags/add
/answers/{id}/flags/options
to list available flags
Comments
- Post:
/posts/{id}/comments/add
- Edit:
/comments/{id}/edit
- Upvote:
/comments/{id}/upvote
/comments/{id}/upvote/undo
to undo
- Delete:
/comments/{id}/delete
- Flag:
/comments/{id}/flags/add
/comments/{id}/flags/options
to list available flags