Users
Create an API key
- ALREADY_EXISTS when the caller already has an active, unexpired key
with that name.
- PERMISSION_DENIED when
parentis not the caller.
- PERMISSION_DENIED when
Scope: apikey:write
Authorization
bearerAuth An API key, or an access token minted from one. Pass it in the Authorization header: Bearer admp_...
In: header
Path Parameters
The user id.
Request Body
application/json
The key to create: name and scopes, and optionally display_name and
expires_at. Output-only fields and resource_name are ignored.
TypeScript Definitions
Use the request body type in TypeScript.
The key to create: name and scopes, and optionally display_name and
expires_at. Output-only fields and resource_name are ignored.
api_key.name.required // an API key needs a name
Response Body
application/json
curl -X POST "https://example.com/v1/users/string/apiKeys" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{ "api_key": { "id": "string", "name": "string", "display_name": "string", "resource_name": "string", "owner_id": "string", "scopes": [ "string" ], "expires_at": "2023-01-15T01:30:15.01Z", "status": "API_KEY_STATUS_UNSPECIFIED", "last_used_at": "2023-01-15T01:30:15.01Z", "revoked_at": "2023-01-15T01:30:15.01Z", "etag": "string", "created_by": { "id": "string", "display_name": "string", "email": "string" }, "created_at": "2023-01-15T01:30:15.01Z", "updated_at": "2023-01-15T01:30:15.01Z" }, "secret": "string"}Update a source PATCH
Updating a source needs permission to create sources, and permission to grant sources when the source holds a grant or the update sets one. PERMISSION_DENIED otherwise, naming the permission. A new grant is checked as CreateSource checks it. Tightening `allows` never touches a running environment, which runs its own stored copy; it bounds new imports and new pushes only. - INVALID_ARGUMENT when the mask names a field that can't be updated. - ABORTED when `etag` is set and the source changed since it was read. Scope: `source:write`
Retrieve an API key GET
- NOT_FOUND when the caller has no key with that resource name. - PERMISSION_DENIED when the resource name's user is not the caller. Scope: `apikey:read`