---
title: "Create Service Key"
method: POST
path: "/api/v1/user/service-keys"
tags: ["main"]
---

# Create Service Key

`POST /api/v1/user/service-keys`

## Request

- Base URL: `https://app.dograh.com`
- URL: `https://app.dograh.com/api/v1/user/service-keys`
- Auth: none declared

Create a legacy OSS trial key or a verified hosted account key.

## Headers

- `authorization` string, nullable
- `X-API-Key` string, nullable

## Request body

- CreateServiceKeyRequest
  - `name` string, required
  - `expires_in_days` integer, nullable

## Response `200`

Successful Response

- CreateServiceKeyResponse
  - `id` integer, required
  - `name` string, required
  - `service_key` string, required
  - `key_prefix` string, required
  - `expires_at` string, date-time, nullable

## Other responses

- `404`: Not found
- `422`: Validation Error

## Changes

- **2026-11-03** `faa00cf76fcb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dograh/apis/dograh-api/changes/api/v1/user/service-keys/post.md)

---

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