# HTTP status codes in Jira and Confluence REST calls

URL: https://goingstellar.ro/reference/atlassian-rest-api/http-status-codes/

Both APIs use standard status codes, but a few real cases do not match the first guess. Edits answer 204 with no body, bulk create answers 201 even when some items fail, a removed endpoint answers 410, a stale Confluence version answers 409, and a missing CSRF header answers 404 on Jira and 403 on Confluence.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| POST | `/rest/api/3/issue` | 201 on success with id, key and self. |
| PUT | `/rest/api/3/issue/{issueIdOrKey}` | 204 with no body on success. |
| POST | `/rest/api/3/issue/bulk` | 201 when at least one item was created. |
| PUT | `/wiki/api/v2/pages/{id}` | 409 when the version number is not incremented. |

## Examples

### POST /rest/api/3/issue

A successful create is 201 and returns only identifiers.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "project": {
      "key": "WEB"
    },
    "issuetype": {
      "name": "Task"
    },
    "summary": "Example created through REST API",
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Created with POST /rest/api/3/issue."
            }
          ]
        }
      ]
    },
    "labels": [
      "api-example"
    ],
    "duedate": "2026-12-15"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'project': {'key': 'WEB'},
                     'issuetype': {'name': 'Task'},
                     'summary': 'Example created through REST API',
                     'description': {'type': 'doc',
                                     'version': 1,
                                     'content': [{'type': 'paragraph',
                                                  'content': [{'type': 'text',
                                                               'text': 'Created with POST '
                                                                       '/rest/api/3/issue.'}]}]},
                     'labels': ['api-example'],
                     'duedate': '2026-12-15'}},
)
print(r.status_code, r.text)
```

Response: HTTP 201

```
{
 "id": "10768",
 "key": "WEB-57",
 "self": "https://your-domain.atlassian.net/rest/api/3/issue/10768"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### PUT /rest/api/3/issue/{issueIdOrKey}

A successful edit is 204 and has no body to parse.

```bash
curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "fields": {
    "summary": "REST API reference test issue - edited"
  }
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'fields': {'summary': 'REST API reference test issue - edited'}},
)
print(r.status_code, r.text)
```

Response: HTTP 204

No response body.

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /rest/api/3/issue/bulk

One valid and one invalid item: 201 with the created work item and an errors array for the failed one.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "issueUpdates": [
    {
      "fields": {
        "project": {
          "key": "WEB"
        },
        "issuetype": {
          "name": "Task"
        },
        "summary": "Bulk example 1"
      }
    },
    {
      "fields": {
        "project": {
          "key": "WEB"
        },
        "issuetype": {
          "name": "NoSuchType"
        },
        "summary": "Bulk example 2"
      }
    }
  ]
}' \
  'https://your-domain.atlassian.net/rest/api/3/issue/bulk'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue/bulk',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'issueUpdates': [{'fields': {'project': {'key': 'WEB'},
                                       'issuetype': {'name': 'Task'},
                                       'summary': 'Bulk example 1'}},
                           {'fields': {'project': {'key': 'WEB'},
                                       'issuetype': {'name': 'NoSuchType'},
                                       'summary': 'Bulk example 2'}}]},
)
print(r.status_code, r.text)
```

Response: HTTP 201

```
{
 "issues": [
  {
   "id": "10770",
   "key": "WEB-59",
   "self": "https://your-domain.atlassian.net/rest/api/3/issue/10770"
  }
 ],
 "errors": [
  {
   "status": 400,
   "elementErrors": {
    "errorMessages": [],
    "errors": {
     "issuetype": "Specify a valid issue type"
    }
   },
   "failedElementNumber": 1
  }
 ]
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /rest/api/3/search

A removed endpoint answers 410 with a migration message.

```bash
curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'jql=project = WEB' \
  --data-urlencode 'maxResults=1' \
  'https://your-domain.atlassian.net/rest/api/3/search'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/search',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'jql': 'project = WEB', 'maxResults': '1'},
)
print(r.status_code, r.text)
```

Response: HTTP 410

```
{
 "errorMessages": [
  "The requested API has been removed. Please migrate to the /rest/api/3/search/jql API. A full migration guideline is available at https://developer.atlassian.com/changelog/#CHANGE-2046"
 ],
 "errors": {}
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### PUT /wiki/api/v2/pages/{pageId}

Updating a page with the current version number answers 409 CONFLICT.

```bash
curl -X PUT \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "id": "{pageId}",
  "status": "current",
  "title": "Example page",
  "version": {
    "number": 2
  },
  "body": {
    "representation": "storage",
    "value": "<p>Stale.</p>"
  }
}' \
  'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.put(
    'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'id': '{pageId}',
          'status': 'current',
          'title': 'Example page',
          'version': {'number': 2},
          'body': {'representation': 'storage', 'value': '<p>Stale.</p>'}},
)
print(r.status_code, r.text)
```

Response: HTTP 409

```
{
 "errors": [
  {
   "status": 409,
   "code": "CONFLICT",
   "title": "Version must be incremented when updating a page. Current Version: [2]. Provided version: [2]",
   "detail": null
  }
 ]
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /rest/api/3/issue/{issueIdOrKey}/attachments

An upload without X-Atlassian-Token answers 404 on Jira, with a plain text body.

```bash
# notes.txt contains: hello
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -F "file=@notes.txt" \
  'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/attachments'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}/attachments',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    files={"file": ('notes.txt', b'hello')},
)
print(r.status_code, r.text)
```

Response: HTTP 404

```
XSRF check failed
```

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- POST /rest/api/3/issue answered 201 and PUT /rest/api/3/issue/{issueIdOrKey} answered 204 with an empty body.
- POST /rest/api/3/issue/bulk answered 201 although the second item had an invalid type. The response lists failedElementNumber 1 and the elementErrors for it.
- GET /rest/api/3/search answered 410, and so did GET /rest/api/2/search, with a message pointing to /rest/api/3/search/jql.
- A Confluence page update with version.number equal to the current version answered 409 with code CONFLICT and a title that states both numbers.
- Both a missing resource and an inaccessible one answer 404 on Jira work items, so 404 does not separate the two.

## Pitfalls

- Do not treat 201 from bulk create as all-succeeded. Read the errors array and compare issues to the request length.
- Do not parse a body after 204. Check the status before calling json().
- A 404 on an upload endpoint can be a CSRF rejection and not a missing work item.
- Retry only on 429 and transient 5xx. A 409 or 400 repeats the same failure until the request changes.

## Questions and answers

### Why is my edit empty?

A successful PUT to a work item is 204 No Content. A run with returnIssue=true on the same endpoint answered 200 instead.

### What does 410 mean from Jira?

The endpoint was removed. For search it names /rest/api/3/search/jql as the replacement.

## Related

- [Error response formats](https://goingstellar.ro/reference/atlassian-rest-api/error-responses/)
- [X-Atlassian-Token: no-check](https://goingstellar.ro/reference/atlassian-rest-api/xsrf-no-check-header/)
- [Rate limits and 429](https://goingstellar.ro/reference/atlassian-rest-api/rate-limits-and-429/)
- [Bulk create work items](https://goingstellar.ro/reference/atlassian-rest-api/bulk-create-issues/)
- [Update a page and versions](https://goingstellar.ro/reference/atlassian-rest-api/update-page-versions/)
- [The removed /search endpoint](https://goingstellar.ro/reference/atlassian-rest-api/removed-search-endpoint/)

## Sources

- [The Jira Cloud platform REST API v3 (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/)
- [The Confluence Cloud REST API v2 (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/)
- [Bulk create issue (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-bulk-post)
- [Add attachment (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post)

