---
title: "Exchange a claimed space's key for an API key"
method: POST
path: "/v1/claim/exchange"
tags: ["Publishing"]
---

# Exchange a claimed space's key for an API key

`POST /v1/claim/exchange`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/claim/exchange`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

One-time exchange of a demoted space key (bearer) for a durable publish API key, available after the owner claimed the space with agent continuation enabled. The API key is shown exactly once; store it and retry the failed request with it.

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `space` object, required
      - `id` string, required
      - `slug` string, required
      - `liveUrl` string, nullable, required
    - `credential` object, required
      - `accessToken` string, required: Durable publish API key minted by the one-time exchange. Shown exactly once. Store it (for example, in .spacefast/state.json) and never print it.
      - `accessTokenId` string, required
      - `label` string, nullable, required
      - `teamId` string, required

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
