Access

Create a user-owned Postdot API key

POST
/api/api-keys

Authorization

sessionCookie
cookiebetter-auth.session_token<token>

The Better Auth email/password session cookie used by the web application.

Request Body

  1. body
name?string
Lengthlength <= 100
projectIds?array<>|null
actionAccess?array<string|string|string|string|string|string|string>|null
expiresAt?|null

Response Body

Response for status 201

application/json
  1. response
key*
token*string

The plaintext API key. It is returned only once when the key is created.

Length1 <= length
Example Request
curl -X POST 'https://postbot.example/api/api-keys' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example Response
{
  "key": {
    "id": "string",
    "name": "string",
    "tokenPrefix": "string",
    "projectAccess": "all",
    "actionAccess": "all",
    "expiresAt": 0,
    "createdAt": 0,
    "updatedAt": 0
  },
  "token": "string"
}

Was this page helpful?