---
title: "Create api tokens to access api"
method: POST
path: "/workspaces/{workspace_id}/clientapps"
tags: ["Client Apps"]
---

# Create api tokens to access api

`POST /workspaces/{workspace_id}/clientapps`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/clientapps`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Create api tokens to a user for a workspace to access APIs

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.

## Request body

- ClientAppCreate: Details of the app to be created
  - `app_name` string, required: Name of client app or api tokens
  - `description` string, required: Description of client app or api tokens
  - `project_id` integer, nullable: Project ID

## Response `201`

Successful create

- ClientAppPostResponse
  - `app_name` string, required: Name of client app or api tokens
  - `app_key` string, required: App key of client app or api tokens
  - `description` string, required: Description of client app or api tokens
  - `workspace_id` integer, required: Workspace ID of client app or api tokens
  - `user_id` integer, required: User ID of client app or api tokens
  - `token` string, required: The plaintext Bearer token. Returned exactly once — it is never recoverable after this response.
  - `expires_at` string, date-time, nullable: When the token stops working (UTC). Null = it never expires. Set on a token the Mammoth CLI creates.

## Other responses

- `400`: Bad Request
- `401`: Authorization error
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
