For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
    • Overview
  • Runtype API
      • POSTCreate product
      • PUTUpdate product
      • POSTAdd capability to product
      • PUTUpdate capability
      • POSTCreate surface
      • PUTUpdate surface
      • POSTAdd item to surface
      • PUTUpdate surface item
      • POSTCreate surface API key
      • POSTCreate schedule for surface
      • PUTUpdate schedule
Dashboard
LogoLogo
Runtype APIProducts

Create surface API key

POST
/v1/products/:id/surfaces/:surfaceId/keys
POST
/v1/products/:id/surfaces/:surfaceId/keys
$curl -X POST https://api.runtype.com/v1/products/id/surfaces/surfaceId/keys \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "id": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
3 "surfaceId": "surface-12345",
4 "name": "Primary API Key",
5 "key": "sk_live_4e5f6g7h8i9j0klmnop",
6 "keyPrefix": "sk_live_4e5f",
7 "keyHint": "Last used 2024-06-01",
8 "scopes": [
9 "read:products",
10 "write:orders"
11 ],
12 "rateLimitPerMinute": 100,
13 "rateLimitPerDay": 10000,
14 "expiresAt": "2025-06-01T00:00:00Z",
15 "isActive": true,
16 "environment": "production",
17 "createdAt": "2024-05-01T12:00:00Z"
18}
Create a new API key for a surface. The plaintext key is only returned on creation.
Was this page helpful?
Previous

Create schedule for surface

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Path parameters

idstringRequired
surfaceIdstringRequired

Request

This endpoint expects an object.
namestringOptional<=255 characters
scopeslist of stringsOptional
rateLimitPerMinuteintegerOptional>=1
rateLimitPerDayintegerOptional>=1
expiresAtdatetimeOptional
environmentenumOptionalDefaults to test
Allowed values:

Response

Surface key created
idstring
surfaceIdstring
namestring or null
keystring
keyPrefixstring
keyHintstring or null
scopeslist of strings
rateLimitPerMinuteinteger or null
rateLimitPerDayinteger or null
expiresAtstring or null
isActiveboolean
environmentstring
createdAtstring

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error