# Confluence REST API v1 vs v2

URL: https://goingstellar.ro/reference/atlassian-rest-api/confluence-v1-vs-v2/

Confluence Cloud serves two REST APIs side by side. v2 lives under /wiki/api/v2, returns string ids and pages through a cursor in the Link header. v1 lives under /wiki/rest/api, uses the expand parameter, and still answered every call on 29 Nov 2026 while sending a Deprecation header. Pick v2 where it has the operation, and fall back to v1 for the rest.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| GET | `/wiki/api/v2/pages/{id}` | v2: reads a page; the body comes back only for the format named in body-format. |
| GET | `/wiki/api/v2/spaces` | v2: lists spaces, filterable by keys. |
| POST | `/wiki/rest/api/content/{id}/label` | v1: adds labels to a piece of content. |
| GET | `/wiki/rest/api/search` | v1: CQL search. |

## Examples

### GET /wiki/rest/api/content/{pageId}

v1 reads a page and asks for the body, version and space in one call through expand.

```bash
curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'expand=body.storage,version,space' \
  'https://your-domain.atlassian.net/wiki/rest/api/content/{pageId}'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/rest/api/content/{pageId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'expand': 'body.storage,version,space'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "id": "33653083",
 "type": "page",
 "status": "current",
 "title": "Example page",
 "space": {
  "id": 655364,
  "key": "SD"
 },
 "version": {
  "message": "",
  "number": 1
 },
 "body": {
  "storage": {
   "value": "<p>Example page body.</p>",
   "representation": "storage"
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

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

v2 reads the same page; the body is asked for with body-format and the ids are strings.

```bash
curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'body-format=storage' \
  'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/api/v2/pages/{pageId}',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'body-format': 'storage'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "parentId": "655541",
 "version": {
  "number": 1,
  "message": ""
 },
 "spaceId": "655364",
 "status": "current",
 "body": {
  "storage": {
   "representation": "storage",
   "value": "<p>Example page body.</p>"
  }
 },
 "title": "Example page",
 "id": "33653083"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /wiki/rest/api/space/SD

v1 space lookup by key. The space id is a number in this call.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/wiki/rest/api/space/SD'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/rest/api/space/SD',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "id": 655364,
 "key": "SD",
 "name": "Software Development",
 "type": "onboarding",
 "status": "current"
}
```

Response headers:

```
Warning: 299 - "Deprecated API, will be removed on Mon, 31 Mar 2025 00:00:00 GMT"
Deprecation: Wed, 1 Mar 2023 00:00:00 GMT
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /wiki/api/v2/spaces

v2 space lookup by key. The same space comes back with a string id and a homepageId.

```bash
curl -G \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  --data-urlencode 'keys=SD' \
  'https://your-domain.atlassian.net/wiki/api/v2/spaces'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/wiki/api/v2/spaces',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    params={'keys': 'SD'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "results": [
  {
   "homepageId": "655541",
   "status": "current",
   "name": "Software Development",
   "key": "SD",
   "id": "655364",
   "type": "onboarding"
  }
 ]
}
```

Response headers:

```
Link: <https://your-domain.atlassian.net/wiki>; rel="base"
```

Sent to Atlassian Cloud on 29 Nov 2026.

### POST /wiki/rest/api/content

v1 page creation with the parent given as an ancestor and the space given by key.

```bash
curl -X POST \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "type": "page",
  "title": "Example page created with v1",
  "space": {
    "key": "SD"
  },
  "ancestors": [
    {
      "id": "{pageId}"
    }
  ],
  "body": {
    "storage": {
      "value": "<p>v1</p>",
      "representation": "storage"
    }
  }
}' \
  'https://your-domain.atlassian.net/wiki/rest/api/content'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.post(
    'https://your-domain.atlassian.net/wiki/rest/api/content',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
    json={'type': 'page',
          'title': 'Example page created with v1',
          'space': {'key': 'SD'},
          'ancestors': [{'id': '{pageId}'}],
          'body': {'storage': {'value': '<p>v1</p>', 'representation': 'storage'}}},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "id": "33784019",
 "type": "page",
 "status": "current",
 "title": "Example page created with v1",
 "space": {
  "key": "SD"
 },
 "ancestors": [
  {
   "id": "655541",
   "title": "Software Development"
  }
 ],
 "body": {
  "storage": {
   "value": "<p>v1</p>",
   "representation": "storage"
  }
 }
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- v1 calls on 29 Nov 2026 returned 200 and carried a Warning header announcing removal on 31 Mar 2025, a Deprecation header dated 1 Mar 2023 and a Link header with rel="deprecation" (conf-space-v1, conf-page-get-v1-expand, conf-page-create-v1). v2 responses carry none of these.
- v1 returns the space id as a number (655364); v2 returns it as a string ("655364"). Page ids are strings in both.
- v2 returns an empty body object unless body-format is set (conf-page-get). v1 returned a body in the run only because expand=body.storage was set.
- A page created with v1 shows up in the v2 children listing of its parent (conf-page-children), so both APIs read and write the same content.

## Pitfalls

- Page ids, space ids and version numbers have different shapes in v1 and v2 (number vs string for space ids), so a client that mixes both needs to normalise them.
- The v2 OpenAPI spec has no search path, no multipart attachment upload and no current-user path, so those calls stay on v1.
- A Deprecation header with a removal date in the past does not mean the endpoint is gone. Read the header, plan the move, and check the Confluence changelog before relying on it.

## Questions and answers

### Is Confluence REST API v1 removed?

Not on 29 Nov 2026. The v1 calls in these examples returned 200 and sent a Warning header that names 31 Mar 2025 as the removal date.

### Which API paginates with a cursor?

v2 does. The next URL is in the Link header and in _links.next of the body.

## Related

- [Get a page](https://goingstellar.ro/reference/atlassian-rest-api/get-page/)
- [Create a page](https://goingstellar.ro/reference/atlassian-rest-api/create-page/)
- [CQL search through the API](https://goingstellar.ro/reference/atlassian-rest-api/cql-search-api/)
- [Attachments](https://goingstellar.ro/reference/atlassian-rest-api/confluence-attachments/)
- [The current user in Confluence](https://goingstellar.ro/reference/atlassian-rest-api/confluence-current-user/)

## Sources

- [The Confluence Cloud REST API v2 (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/)
- [The Confluence Cloud REST API v1 (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/rest/v1/intro/)
- [Using the REST API, Confluence (Atlassian Developer)](https://developer.atlassian.com/cloud/confluence/using-the-rest-api/)

