Docs

Api Keys

GET
/v1/api-keys

Retrieve all API keys for the current workspace.

AuthorizationBearer <token>

API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys

In: header

Query Parameters

workspace?string

Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.

Match^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$
Length4 <= length <= 100
project?string

Filter by project ID or name.

Lengthlength <= 100
limit?integer

Maximum number of items to return per page

Range1 <= value <= 100
Default20
cursor?string

Cursor for pagination - omit for first page

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/api-keys?project=my-project"
{  "items": [    {      "id": "apikey_ye96yxs1tjnrrwulp8frh",      "description": "string",      "keyPrefix": "string",      "type": "workspace",      "role": "string",      "workspaceId": "string",      "projectId": "string",      "deploymentId": "string",      "deploymentGroupId": "string",      "managerId": "string",      "enabled": true,      "createdAt": "2019-08-24T14:15:22Z",      "expiresAt": "2019-08-24T14:15:22Z",      "lastUsedAt": "2019-08-24T14:15:22Z",      "revokedAt": "2019-08-24T14:15:22Z",      "deploymentSetupConfig": {        "metadata": {          "property1": null,          "property2": null        },        "policy": {          "allowedPlatforms": [            "aws"          ],          "allowedKubernetesBasePlatforms": [            "aws"          ],          "allowedKubernetesClusterSources": [            "create"          ],          "allowedSetupMethods": [            "cloudformation"          ],          "allowReleasePinning": true,          "stackSettings": {            "defaults": {              "compute": {                "pools": {                  "property1": {                    "failure_domains": {                      "selectedFailureDomains": [                        "string"                      ],                      "spread": 0                    },                    "machine": "string",                    "machines": 0,                    "mode": "fixed"                  },                  "property2": {                    "failure_domains": {                      "selectedFailureDomains": [                        "string"                      ],                      "spread": 0                    },                    "machine": "string",                    "machines": 0,                    "mode": "fixed"                  }                }              },              "deploymentModel": "push",              "domains": {                "customDomains": {                  "property1": {                    "certificate": {                      "aws": {                        "certificateArn": "string"                      },                      "azure": {                        "keyVaultCertificateId": "string",                        "keyVaultResourceId": "string"                      },                      "gcp": {                        "certificateName": "string"                      },                      "kubernetes": {                        "tlsSecretRef": {                          "namespace": "string",                          "secretName": "string"                        }                      }                    },                    "domain": "string"                  },                  "property2": {                    "certificate": {                      "aws": {                        "certificateArn": "string"                      },                      "azure": {                        "keyVaultCertificateId": "string",                        "keyVaultResourceId": "string"                      },                      "gcp": {                        "certificateName": "string"                      },                      "kubernetes": {                        "tlsSecretRef": {                          "namespace": "string",                          "secretName": "string"                        }                      }                    },                    "domain": "string"                  }                },                "publicEndpointTarget": {                  "mode": "machineAddresses"                }              },              "externalBindings": {},              "heartbeats": "off",              "kubernetes": {                "cluster": {                  "cloud": {                    "accountId": "string",                    "clusterId": "string",                    "clusterName": "string",                    "projectId": "string",                    "region": "string",                    "resourceGroup": "string",                    "subscriptionId": "string"                  },                  "namespace": "string",                  "ownership": "managed"                },                "exposure": {                  "mode": "disabled"                }              },              "network": {                "type": "use-default"              },              "telemetry": "off",              "updates": "auto"            },            "allowedDeploymentModels": [              "push"            ],            "allowedNetworkModes": [              "none"            ],            "allowedUpdatesModes": [              "auto"            ],            "allowedTelemetryModes": [              "auto"            ],            "allowedHeartbeatsModes": [              "on"            ],            "allowExternalBindings": true,            "allowCustomRegistry": true          }        },        "environmentVariables": [          {            "name": "string",            "type": "plain",            "targetResources": [              "string"            ]          }        ],        "items": [          {            "item": "deployment",            "source": {              "type": "project-release",              "releaseChannel": "string",              "releaseId": "rel_WbhQgksrawSKIpEN0NAssHX9",              "resourceId": "string"            },            "required": true,            "configuration": {              "allowedProviders": [                "aws-bedrock"              ],              "providerAllowlist": [                "aws-bedrock"              ],              "modelRequirements": [                {                  "publicModelId": "string",                  "clientApis": [                    "openai-chat"                  ],                  "required": true                }              ]            }          }        ]      },      "createdByUser": {        "id": "string",        "email": "string",        "image": "string"      }    }  ],  "nextCursor": "string"}
POST
/v1/api-keys

Create a new API key.

AuthorizationBearer <token>

API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys

In: header

Query Parameters

workspace?string

Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.

Match^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$
Length4 <= length <= 100

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request schema for creating a new API key

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{    "description": "string",    "scope": {      "type": "workspace",      "role": "workspace.member"    },    "expiresAt": "2019-08-24T14:15:22Z"  }'
{  "apiKey": "string",  "keyInfo": {    "id": "apikey_ye96yxs1tjnrrwulp8frh",    "description": "string",    "keyPrefix": "string",    "type": "workspace",    "role": "string",    "workspaceId": "string",    "projectId": "string",    "deploymentId": "string",    "deploymentGroupId": "string",    "managerId": "string",    "enabled": true,    "createdAt": "2019-08-24T14:15:22Z",    "expiresAt": "2019-08-24T14:15:22Z",    "lastUsedAt": "2019-08-24T14:15:22Z",    "revokedAt": "2019-08-24T14:15:22Z",    "deploymentSetupConfig": {      "metadata": {        "property1": null,        "property2": null      },      "policy": {        "allowedPlatforms": [          "aws"        ],        "allowedKubernetesBasePlatforms": [          "aws"        ],        "allowedKubernetesClusterSources": [          "create"        ],        "allowedSetupMethods": [          "cloudformation"        ],        "allowReleasePinning": true,        "stackSettings": {          "defaults": {            "compute": {              "pools": {                "property1": {                  "failure_domains": {                    "selectedFailureDomains": [                      "string"                    ],                    "spread": 0                  },                  "machine": "string",                  "machines": 0,                  "mode": "fixed"                },                "property2": {                  "failure_domains": {                    "selectedFailureDomains": [                      "string"                    ],                    "spread": 0                  },                  "machine": "string",                  "machines": 0,                  "mode": "fixed"                }              }            },            "deploymentModel": "push",            "domains": {              "customDomains": {                "property1": {                  "certificate": {                    "aws": {                      "certificateArn": "string"                    },                    "azure": {                      "keyVaultCertificateId": "string",                      "keyVaultResourceId": "string"                    },                    "gcp": {                      "certificateName": "string"                    },                    "kubernetes": {                      "tlsSecretRef": {                        "namespace": "string",                        "secretName": "string"                      }                    }                  },                  "domain": "string"                },                "property2": {                  "certificate": {                    "aws": {                      "certificateArn": "string"                    },                    "azure": {                      "keyVaultCertificateId": "string",                      "keyVaultResourceId": "string"                    },                    "gcp": {                      "certificateName": "string"                    },                    "kubernetes": {                      "tlsSecretRef": {                        "namespace": "string",                        "secretName": "string"                      }                    }                  },                  "domain": "string"                }              },              "publicEndpointTarget": {                "mode": "machineAddresses"              }            },            "externalBindings": {},            "heartbeats": "off",            "kubernetes": {              "cluster": {                "cloud": {                  "accountId": "string",                  "clusterId": "string",                  "clusterName": "string",                  "projectId": "string",                  "region": "string",                  "resourceGroup": "string",                  "subscriptionId": "string"                },                "namespace": "string",                "ownership": "managed"              },              "exposure": {                "mode": "disabled"              }            },            "network": {              "type": "use-default"            },            "telemetry": "off",            "updates": "auto"          },          "allowedDeploymentModels": [            "push"          ],          "allowedNetworkModes": [            "none"          ],          "allowedUpdatesModes": [            "auto"          ],          "allowedTelemetryModes": [            "auto"          ],          "allowedHeartbeatsModes": [            "on"          ],          "allowExternalBindings": true,          "allowCustomRegistry": true        }      },      "environmentVariables": [        {          "name": "string",          "type": "plain",          "targetResources": [            "string"          ]        }      ],      "items": [        {          "item": "deployment",          "source": {            "type": "project-release",            "releaseChannel": "string",            "releaseId": "rel_WbhQgksrawSKIpEN0NAssHX9",            "resourceId": "string"          },          "required": true,          "configuration": {            "allowedProviders": [              "aws-bedrock"            ],            "providerAllowlist": [              "aws-bedrock"            ],            "modelRequirements": [              {                "publicModelId": "string",                "clientApis": [                  "openai-chat"                ],                "required": true              }            ]          }        }      ]    }  }}
GET
/v1/api-keys/{id}

Retrieve a specific API key.

AuthorizationBearer <token>

API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys

In: header

Path Parameters

id*string

Unique identifier for the api key.

Matchapikey_[0-9a-z]{28}$

Query Parameters

workspace?string

Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.

Match^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$
Length4 <= length <= 100

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/api-keys/apikey_ye96yxs1tjnrrwulp8frh"
{  "id": "apikey_ye96yxs1tjnrrwulp8frh",  "description": "string",  "keyPrefix": "string",  "type": "workspace",  "role": "string",  "workspaceId": "string",  "projectId": "string",  "deploymentId": "string",  "deploymentGroupId": "string",  "managerId": "string",  "enabled": true,  "createdAt": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "lastUsedAt": "2019-08-24T14:15:22Z",  "revokedAt": "2019-08-24T14:15:22Z",  "deploymentSetupConfig": {    "metadata": {      "property1": null,      "property2": null    },    "policy": {      "allowedPlatforms": [        "aws"      ],      "allowedKubernetesBasePlatforms": [        "aws"      ],      "allowedKubernetesClusterSources": [        "create"      ],      "allowedSetupMethods": [        "cloudformation"      ],      "allowReleasePinning": true,      "stackSettings": {        "defaults": {          "compute": {            "pools": {              "property1": {                "failure_domains": {                  "selectedFailureDomains": [                    "string"                  ],                  "spread": 0                },                "machine": "string",                "machines": 0,                "mode": "fixed"              },              "property2": {                "failure_domains": {                  "selectedFailureDomains": [                    "string"                  ],                  "spread": 0                },                "machine": "string",                "machines": 0,                "mode": "fixed"              }            }          },          "deploymentModel": "push",          "domains": {            "customDomains": {              "property1": {                "certificate": {                  "aws": {                    "certificateArn": "string"                  },                  "azure": {                    "keyVaultCertificateId": "string",                    "keyVaultResourceId": "string"                  },                  "gcp": {                    "certificateName": "string"                  },                  "kubernetes": {                    "tlsSecretRef": {                      "namespace": "string",                      "secretName": "string"                    }                  }                },                "domain": "string"              },              "property2": {                "certificate": {                  "aws": {                    "certificateArn": "string"                  },                  "azure": {                    "keyVaultCertificateId": "string",                    "keyVaultResourceId": "string"                  },                  "gcp": {                    "certificateName": "string"                  },                  "kubernetes": {                    "tlsSecretRef": {                      "namespace": "string",                      "secretName": "string"                    }                  }                },                "domain": "string"              }            },            "publicEndpointTarget": {              "mode": "machineAddresses"            }          },          "externalBindings": {},          "heartbeats": "off",          "kubernetes": {            "cluster": {              "cloud": {                "accountId": "string",                "clusterId": "string",                "clusterName": "string",                "projectId": "string",                "region": "string",                "resourceGroup": "string",                "subscriptionId": "string"              },              "namespace": "string",              "ownership": "managed"            },            "exposure": {              "mode": "disabled"            }          },          "network": {            "type": "use-default"          },          "telemetry": "off",          "updates": "auto"        },        "allowedDeploymentModels": [          "push"        ],        "allowedNetworkModes": [          "none"        ],        "allowedUpdatesModes": [          "auto"        ],        "allowedTelemetryModes": [          "auto"        ],        "allowedHeartbeatsModes": [          "on"        ],        "allowExternalBindings": true,        "allowCustomRegistry": true      }    },    "environmentVariables": [      {        "name": "string",        "type": "plain",        "targetResources": [          "string"        ]      }    ],    "items": [      {        "item": "deployment",        "source": {          "type": "project-release",          "releaseChannel": "string",          "releaseId": "rel_WbhQgksrawSKIpEN0NAssHX9",          "resourceId": "string"        },        "required": true,        "configuration": {          "allowedProviders": [            "aws-bedrock"          ],          "providerAllowlist": [            "aws-bedrock"          ],          "modelRequirements": [            {              "publicModelId": "string",              "clientApis": [                "openai-chat"              ],              "required": true            }          ]        }      }    ]  },  "createdByUser": {    "id": "string",    "email": "string",    "image": "string"  }}
PATCH
/v1/api-keys/{id}

Update an API key (enable/disable, change description).

AuthorizationBearer <token>

API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys

In: header

Path Parameters

id*string

Unique identifier for the api key.

Matchapikey_[0-9a-z]{28}$

Query Parameters

workspace?string

Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.

Match^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$
Length4 <= length <= 100

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request schema for updating an API key

Response Body

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/api-keys/apikey_ye96yxs1tjnrrwulp8frh" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "apikey_ye96yxs1tjnrrwulp8frh",  "description": "string",  "keyPrefix": "string",  "type": "workspace",  "role": "string",  "workspaceId": "string",  "projectId": "string",  "deploymentId": "string",  "deploymentGroupId": "string",  "managerId": "string",  "enabled": true,  "createdAt": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "lastUsedAt": "2019-08-24T14:15:22Z",  "revokedAt": "2019-08-24T14:15:22Z",  "deploymentSetupConfig": {    "metadata": {      "property1": null,      "property2": null    },    "policy": {      "allowedPlatforms": [        "aws"      ],      "allowedKubernetesBasePlatforms": [        "aws"      ],      "allowedKubernetesClusterSources": [        "create"      ],      "allowedSetupMethods": [        "cloudformation"      ],      "allowReleasePinning": true,      "stackSettings": {        "defaults": {          "compute": {            "pools": {              "property1": {                "failure_domains": {                  "selectedFailureDomains": [                    "string"                  ],                  "spread": 0                },                "machine": "string",                "machines": 0,                "mode": "fixed"              },              "property2": {                "failure_domains": {                  "selectedFailureDomains": [                    "string"                  ],                  "spread": 0                },                "machine": "string",                "machines": 0,                "mode": "fixed"              }            }          },          "deploymentModel": "push",          "domains": {            "customDomains": {              "property1": {                "certificate": {                  "aws": {                    "certificateArn": "string"                  },                  "azure": {                    "keyVaultCertificateId": "string",                    "keyVaultResourceId": "string"                  },                  "gcp": {                    "certificateName": "string"                  },                  "kubernetes": {                    "tlsSecretRef": {                      "namespace": "string",                      "secretName": "string"                    }                  }                },                "domain": "string"              },              "property2": {                "certificate": {                  "aws": {                    "certificateArn": "string"                  },                  "azure": {                    "keyVaultCertificateId": "string",                    "keyVaultResourceId": "string"                  },                  "gcp": {                    "certificateName": "string"                  },                  "kubernetes": {                    "tlsSecretRef": {                      "namespace": "string",                      "secretName": "string"                    }                  }                },                "domain": "string"              }            },            "publicEndpointTarget": {              "mode": "machineAddresses"            }          },          "externalBindings": {},          "heartbeats": "off",          "kubernetes": {            "cluster": {              "cloud": {                "accountId": "string",                "clusterId": "string",                "clusterName": "string",                "projectId": "string",                "region": "string",                "resourceGroup": "string",                "subscriptionId": "string"              },              "namespace": "string",              "ownership": "managed"            },            "exposure": {              "mode": "disabled"            }          },          "network": {            "type": "use-default"          },          "telemetry": "off",          "updates": "auto"        },        "allowedDeploymentModels": [          "push"        ],        "allowedNetworkModes": [          "none"        ],        "allowedUpdatesModes": [          "auto"        ],        "allowedTelemetryModes": [          "auto"        ],        "allowedHeartbeatsModes": [          "on"        ],        "allowExternalBindings": true,        "allowCustomRegistry": true      }    },    "environmentVariables": [      {        "name": "string",        "type": "plain",        "targetResources": [          "string"        ]      }    ],    "items": [      {        "item": "deployment",        "source": {          "type": "project-release",          "releaseChannel": "string",          "releaseId": "rel_WbhQgksrawSKIpEN0NAssHX9",          "resourceId": "string"        },        "required": true,        "configuration": {          "allowedProviders": [            "aws-bedrock"          ],          "providerAllowlist": [            "aws-bedrock"          ],          "modelRequirements": [            {              "publicModelId": "string",              "clientApis": [                "openai-chat"              ],              "required": true            }          ]        }      }    ]  },  "createdByUser": {    "id": "string",    "email": "string",    "image": "string"  }}
DELETE
/v1/api-keys/{id}

Revoke (soft delete) an API key.

AuthorizationBearer <token>

API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys

In: header

Path Parameters

id*string

Unique identifier for the api key.

Matchapikey_[0-9a-z]{28}$

Query Parameters

workspace?string

Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.

Match^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$
Length4 <= length <= 100

Response Body

application/json

application/json

curl -X DELETE "https://example.com/v1/api-keys/apikey_ye96yxs1tjnrrwulp8frh"
Empty
POST
/v1/api-keys/batch-delete

Permanently delete multiple API keys.

AuthorizationBearer <token>

API key for authentication, must be provided as a Bearer token. Generate an API key at https://alien.dev/api-keys

In: header

Query Parameters

workspace?string

Workspace name. Required for user/session/OAuth requests. Optional for API keys because API keys are workspace-scoped; if provided with an API key, it must match the key's workspace.

Match^(?!ws[-_])[a-z0-9](-?[a-z0-9])*$
Length4 <= length <= 100

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/api-keys/batch-delete" \  -H "Content-Type: application/json" \  -d '{    "ids": [      "apikey_ye96yxs1tjnrrwulp8frh"    ]  }'
{  "deletedCount": 0}