---
title: "Create API client"
method: POST
path: "/api/user/api-clients"
tags: ["User"]
---

# Create API client

`POST /api/user/api-clients`

## Request

- Base URL: `https://demo.hitkeep.com`
- URL: `https://demo.hitkeep.com/api/user/api-clients`
- Auth: API key in cookie `hk_token`

Creates delegated API client and returns one-time token. Site analytics, MCP, and ingest access require explicit site_roles grants.

## Request body

- object
  - `description` string
  - `expires_at` string, date-time
  - `instance_role` string
  - `name` string, required
  - `site_roles` object[]
    - `role` string
    - `site_id` string, uuid

## Response `201`

Created API client

- APIClientCreateResponse
  - `client` APIClient
    - `created_at` string, date-time
    - `description` string
    - `expires_at` string, date-time
    - `id` string, uuid
    - `instance_role` string
    - `last_used_at` string, date-time
    - `name` string
    - `owner_type` 'personal' | 'team'
    - `revoked_at` string, date-time
    - `site_roles` APIClientSiteRole[]: Explicit site grants. Empty means the API client has no site-scoped analytics, MCP, or ingest access.
      - `role` string
      - `site_id` string, uuid
    - `tenant_id` string, uuid
    - `updated_at` string, date-time
    - `user_id` string, uuid
  - `token` string

---

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