http
POST /api-keysCreate an API key and return its secret once.
Servers
JSON
1[2 {3 "url": "https://api.veryfront.com"4 }5]Authentication
JSON
1[2 {3 "bearerAuth": []4 },5 {6 "apiKeyAuth": []7 }8]JSON
1{2 "bearerAuth": {3 "type": "http",4 "scheme": "bearer",5 "bearerFormat": "JWT or API Key",6 "description": "Use a JWT bearer token or a Veryfront API key in the `Authorization` header."7 },8 "apiKeyAuth": {9 "type": "apiKey",10 "in": "header",11 "name": "X-API-Key",12 "description": "Alternative API key header for `vf_<prefix>_<secret>` tokens."13 }14}Request body
JSON
1{2 "content": {3 "application/json": {4 "schema": {5 "type": "object",6 "properties": {7 "project_reference": {8 "type": "string",9 "description": "Project ID or slug. Creating a project-scoped key requires project.api_keys.manage. Omit for a user-level key; a project-scoped API-key caller retains its enforced project when this field is omitted."10 },11 "name": {12 "type": "string",13 "minLength": 1,14 "maxLength": 25515 },16 "scopes": {17 "type": "array",18 "items": {19 "type": "string",20 "examples": [21 "*",22 "read",23 "write",24 "delete",25 "releases:read",26 "releases:write",27 "releases:delete",28 "releases:*",29 "deployments:read",30 "deployments:write",31 "deployments:delete",32 "deployments:*",33 "projects:read",34 "projects:write",35 "projects:delete",36 "projects:*",37 "components:read",38 "components:write",39 "components:delete",40 "components:*",41 "files:read",42 "files:write",43 "files:delete",44 "files:*",45 "uploads:read",46 "uploads:write",47 "uploads:delete",48 "uploads:*",49 "users:read",50 "users:write",51 "users:delete",52 "users:*",53 "pages:read",54 "pages:write",55 "pages:delete",56 "pages:*",57 "cache:read",58 "cache:write",59 "cache:delete",60 "cache:*",61 "runs:read",62 "runs:write",63 "runs:delete",64 "runs:*",65 "integrations:read",66 "integrations:write",67 "integrations:delete",68 "integrations:*",69 "conversations:read",70 "conversations:write",71 "conversations:delete",72 "conversations:*",73 "agents:read",74 "agents:write",75 "agents:delete",76 "agents:*",77 "runtime:read",78 "runtime:write",79 "runtime:delete",80 "runtime:*",81 "sandboxes:read",82 "sandboxes:write",83 "sandboxes:delete",84 "sandboxes:*"85 ]86 },87 "description": "Requested permissions. Schema examples list all currently supported values. Omitted or empty scopes default to read-only (read). Project keys remain restricted by their project and creation permission."88 },89 "expires_at": {90 "type": "string"91 }92 },93 "required": [94 "name"95 ]96 }97 }98 }99}Responses
201
API key created successfully
JSON
1{2 "description": "API key created successfully",3 "content": {4 "application/json": {5 "schema": {6 "type": "object",7 "properties": {8 "id": {9 "type": "string",10 "format": "uuid"11 },12 "project_id": {13 "type": [14 "string",15 "null"16 ],17 "format": "uuid"18 },19 "user_id": {20 "type": "string",21 "format": "uuid"22 },23 "name": {24 "type": "string"25 },26 "key": {27 "type": "string"28 },29 "key_prefix": {30 "type": "string"31 },32 "expires_at": {33 "type": [34 "string",35 "null"36 ]37 },38 "created_at": {39 "type": "string"40 },41 "scopes": {42 "type": "array",43 "items": {44 "type": "string"45 }46 },47 "scope": {48 "type": "string",49 "enum": [50 "account",51 "project"52 ],53 "description": "Whether the key is restricted to one project or applies to the account. An account-wide key acts with its owner’s project roles, limited by the key’s scopes. Unlike project-scoped keys, it can inherit the owner’s administrative authority: `write` can allow API key creation, and `delete` can allow project deletion."54 }55 },56 "required": [57 "id",58 "project_id",59 "user_id",60 "name",61 "key",62 "key_prefix",63 "expires_at",64 "created_at",65 "scopes",66 "scope"67 ]68 }69 }70 }71}400
Bad request
JSON
1{2 "description": "Bad request",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}401
Unauthorized
JSON
1{2 "description": "Unauthorized",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}403
Forbidden
JSON
1{2 "description": "Forbidden",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}404
Not found
JSON
1{2 "description": "Not found",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}500
Server error
JSON
1{2 "description": "Server error",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}503
internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.
JSON
1{2 "description": "internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.",3 "content": {4 "application/problem+json": {5 "schema": {6 "$ref": "#/components/schemas/Problem"7 }8 }9 }10}Referenced contracts
components/schemas/Problem
JSON
1{2 "type": "object",3 "properties": {4 "cause": {5 "type": "string",6 "enum": [7 "schedule_concurrency_forbidden",8 "schedule_fire_in_progress",9 "schedule_run_limit_reached"10 ],11 "description": "Schedule admission refusal."12 },13 "idempotency": {14 "type": "object",15 "properties": {16 "state": {17 "type": "string",18 "enum": [19 "in_progress",20 "payload_mismatch",21 "outcome_unknown"22 ]23 },24 "operation": {25 "type": "string",26 "minLength": 127 },28 "retryable": {29 "type": "boolean"30 },31 "retry_after_seconds": {32 "type": [33 "integer",34 "null"35 ],36 "minimum": 037 },38 "expires_at": {39 "type": [40 "string",41 "null"42 ]43 },44 "recovery": {45 "type": "object",46 "properties": {47 "available": {48 "type": "boolean"49 },50 "description": {51 "type": "string"52 },53 "resource_url": {54 "type": "string"55 }56 },57 "required": [58 "available",59 "description"60 ]61 }62 },63 "required": [64 "state",65 "operation",66 "retryable",67 "retry_after_seconds",68 "expires_at"69 ],70 "description": "Replay status, retry timing, and recovery lookup."71 },72 "type": {73 "type": "string",74 "description": "URI reference identifying the problem type",75 "example": "https://api.veryfront.com/errors/validation-failed"76 },77 "title": {78 "type": "string",79 "description": "Short human-readable summary of the problem",80 "example": "Validation Failed"81 },82 "status": {83 "type": "integer",84 "minimum": 100,85 "maximum": 599,86 "description": "HTTP status code",87 "example": 40088 },89 "code": {90 "type": "string",91 "description": "Stable machine-readable error code",92 "example": "RUN_INVALID_INPUT"93 },94 "detail": {95 "type": "string",96 "description": "Human-readable explanation specific to this occurrence",97 "example": "The 'email' field must be a valid email address"98 },99 "instance": {100 "type": "string",101 "description": "URI reference identifying the specific occurrence",102 "example": "/projects/my-project/members"103 },104 "slug": {105 "type": "string",106 "description": "Stable identifier for the problem type",107 "example": "validation-failed"108 },109 "category": {110 "type": "string",111 "enum": [112 "AUTH",113 "RESOURCE",114 "VALIDATION",115 "DATABASE",116 "SUBSCRIPTION",117 "INTEGRATION",118 "INTERNAL"119 ],120 "description": "API error category",121 "example": "VALIDATION"122 },123 "suggestion": {124 "type": "string",125 "description": "Suggested action to resolve the problem",126 "example": "Check the request body and query parameters against the API documentation."127 },128 "errors": {129 "type": "array",130 "items": {131 "type": "object",132 "properties": {133 "field": {134 "type": "string",135 "description": "Field path that caused the error",136 "example": "email"137 },138 "message": {139 "type": "string",140 "description": "Error message for this field",141 "example": "Invalid email format"142 },143 "code": {144 "type": "string",145 "description": "Error code for this field",146 "example": "INVALID_FORMAT"147 }148 },149 "required": [150 "field",151 "message"152 ]153 },154 "description": "Detailed field-level errors for validation failures"155 }156 },157 "required": [158 "type",159 "title",160 "status"161 ]162}Operation contract
JSON
1{2 "operationId": "createApiKey",3 "tags": [4 "identity-access/API keys/API keys"5 ],6 "summary": "Create API key",7 "description": "Create an API key and return its secret once.",8 "requestBody": {9 "content": {10 "application/json": {11 "schema": {12 "type": "object",13 "properties": {14 "project_reference": {15 "type": "string",16 "description": "Project ID or slug. Creating a project-scoped key requires project.api_keys.manage. Omit for a user-level key; a project-scoped API-key caller retains its enforced project when this field is omitted."17 },18 "name": {19 "type": "string",20 "minLength": 1,21 "maxLength": 25522 },23 "scopes": {24 "type": "array",25 "items": {26 "type": "string",27 "examples": [28 "*",29 "read",30 "write",31 "delete",32 "releases:read",33 "releases:write",34 "releases:delete",35 "releases:*",36 "deployments:read",37 "deployments:write",38 "deployments:delete",39 "deployments:*",40 "projects:read",41 "projects:write",42 "projects:delete",43 "projects:*",44 "components:read",45 "components:write",46 "components:delete",47 "components:*",48 "files:read",49 "files:write",50 "files:delete",51 "files:*",52 "uploads:read",53 "uploads:write",54 "uploads:delete",55 "uploads:*",56 "users:read",57 "users:write",58 "users:delete",59 "users:*",60 "pages:read",61 "pages:write",62 "pages:delete",63 "pages:*",64 "cache:read",65 "cache:write",66 "cache:delete",67 "cache:*",68 "runs:read",69 "runs:write",70 "runs:delete",71 "runs:*",72 "integrations:read",73 "integrations:write",74 "integrations:delete",75 "integrations:*",76 "conversations:read",77 "conversations:write",78 "conversations:delete",79 "conversations:*",80 "agents:read",81 "agents:write",82 "agents:delete",83 "agents:*",84 "runtime:read",85 "runtime:write",86 "runtime:delete",87 "runtime:*",88 "sandboxes:read",89 "sandboxes:write",90 "sandboxes:delete",91 "sandboxes:*"92 ]93 },94 "description": "Requested permissions. Schema examples list all currently supported values. Omitted or empty scopes default to read-only (read). Project keys remain restricted by their project and creation permission."95 },96 "expires_at": {97 "type": "string"98 }99 },100 "required": [101 "name"102 ]103 }104 }105 }106 },107 "responses": {108 "201": {109 "description": "API key created successfully",110 "content": {111 "application/json": {112 "schema": {113 "type": "object",114 "properties": {115 "id": {116 "type": "string",117 "format": "uuid"118 },119 "project_id": {120 "type": [121 "string",122 "null"123 ],124 "format": "uuid"125 },126 "user_id": {127 "type": "string",128 "format": "uuid"129 },130 "name": {131 "type": "string"132 },133 "key": {134 "type": "string"135 },136 "key_prefix": {137 "type": "string"138 },139 "expires_at": {140 "type": [141 "string",142 "null"143 ]144 },145 "created_at": {146 "type": "string"147 },148 "scopes": {149 "type": "array",150 "items": {151 "type": "string"152 }153 },154 "scope": {155 "type": "string",156 "enum": [157 "account",158 "project"159 ],160 "description": "Whether the key is restricted to one project or applies to the account. An account-wide key acts with its owner’s project roles, limited by the key’s scopes. Unlike project-scoped keys, it can inherit the owner’s administrative authority: `write` can allow API key creation, and `delete` can allow project deletion."161 }162 },163 "required": [164 "id",165 "project_id",166 "user_id",167 "name",168 "key",169 "key_prefix",170 "expires_at",171 "created_at",172 "scopes",173 "scope"174 ]175 }176 }177 }178 },179 "400": {180 "description": "Bad request",181 "content": {182 "application/problem+json": {183 "schema": {184 "$ref": "#/components/schemas/Problem"185 }186 }187 }188 },189 "401": {190 "description": "Unauthorized",191 "content": {192 "application/problem+json": {193 "schema": {194 "$ref": "#/components/schemas/Problem"195 }196 }197 }198 },199 "403": {200 "description": "Forbidden",201 "content": {202 "application/problem+json": {203 "schema": {204 "$ref": "#/components/schemas/Problem"205 }206 }207 }208 },209 "404": {210 "description": "Not found",211 "content": {212 "application/problem+json": {213 "schema": {214 "$ref": "#/components/schemas/Problem"215 }216 }217 }218 },219 "500": {220 "description": "Server error",221 "content": {222 "application/problem+json": {223 "schema": {224 "$ref": "#/components/schemas/Problem"225 }226 }227 }228 },229 "503": {230 "description": "internal: authentication state is temporarily unavailable and the request was not processed; retry shortly.",231 "content": {232 "application/problem+json": {233 "schema": {234 "$ref": "#/components/schemas/Problem"235 }236 }237 }238 }239 },240 "x-documentation-source-tag": "API keys",241 "x-canonical-documentation": {242 "domain": "identity-access",243 "resource": "API keys",244 "subgroup": "API keys",245 "name": "Create API key",246 "description": "Create an API key and return its secret once.",247 "operationId": "createApiKey"248 },249 "x-mint": {250 "href": "/cloud/rest/api-reference/identity-access-api-keys-api-keys/create-api-key"251 }252}