---
title: "Create Api Credential"
method: POST
path: "/users/me/api-credentials"
tags: ["users"]
---

# Create Api Credential

`POST /users/me/api-credentials`

## Request

- Base URL: `https://api.tickertrac.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tickertrac.com/users/me/api-credentials`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Issue an additional API credential limited to the requested scopes (ADR-060).

This route itself requires `account` authority (see credential_scopes.py), which a
stored credential can never hold -- so a scoped credential cannot mint a broader one,
and the only way to widen authority is to sign in.

## Request body

- ApiCredentialIn: Request for a scoped credential (ADR-060). `scopes` is validated in the router against tickerrag.credential_scopes so that an unissuable scope is a 422 rather than a silently narrower key than the caller believes it received.
  - `name` string, required
  - `scopes` string[], required

## Response `201`

Successful Response

- ApiCredentialCreatedOut
  - `id` integer, required
  - `name` string, required
  - `scopes` string[], required
  - `created_at` string, date-time, required
  - `revoked_at` string, date-time, nullable
  - `api_key` string, required

## Other responses

- `422`: Validation Error

---

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