---
title: "Create a buyer account or manage keys"
method: POST
path: "/buyer-account"
tags: ["Buyer account"]
---

# Create a buyer account or manage keys

`POST /buyer-account`

## Request

- Base URL: `https://api.opedd.com`
- URL: `https://api.opedd.com/buyer-account`
- Auth: HTTP bearer

`action`:

- `signup`: creates your buyer account and a first API key (no scopes). `contact_email` must be the email you signed in with, or the answer is 403. `terms_version` is the version of the Opedd Terms of Service you accepted at sign-up (not the Buyer Master Agreement, which you accept when you order).
- `create_key`: a new API key; `scopes` can include `search` (for `POST /search`) and `audit` (audit, compliance and order endpoints); `environment` is `live` (default) or `test`.
- `rotate_key`: issues a new key with the same scopes and revokes `key_id` at once.
- `revoke_key`: revokes `key_id` at once.
- `search_spend`: what your questions to `POST /search` have cost this month, and your monthly ceiling.

A new key is shown once. Keys can never place orders or pay.

## Request body

- union
  - object
    - `action` 'signup', required
    - `first_name` string, required
    - `last_name` string, required
    - `company_name` string, required
    - `company_website` string, uri, required: Starts with `https://` or `http://`.
    - `buyer_type` 'ai_training' | 'ai_retrieval' | 'editorial_republish' | 'research_academic' | 'other', required
    - `country_of_incorporation` string, required: Two-letter country code (ISO 3166-1 alpha-2), for example `GB`.
    - `contact_email` string, email, required: Must be the email you signed in with.
    - `terms_version` string, required: The Terms of Service version you accepted.
  - object
    - `action` 'create_key', required
    - `name` string
    - `environment` 'live' | 'test'
    - `scopes` string[]
  - object
    - `action` 'rotate_key', required
    - `key_id` string, uuid, required
  - object
    - `action` 'revoke_key', required
    - `key_id` string, uuid, required
  - object
    - `action` 'search_spend', required

## Response `200`

`revoke_key` and `search_spend`

## Other responses

- `201`: `signup`, `create_key` and `rotate_key`: the new key, shown once
- `400`: A field is missing or invalid (for example an unknown scope or country code)
- `401`: Missing or invalid sign-in token
- `403`: `contact_email` is not the email you signed in with
- `404`: No buyer account yet, or key not found
- `409`: A buyer account already exists for this sign-in or this email
- `410`: Key already revoked
- `429`: Too many requests
- `503`: Spend could not be read right now. Retry.

---

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