CreateAccessToken - Amazon CodeCatalyst

CreateAccessToken

Creates a personal access token (PAT) for the current user. A personal access token (PAT) is similar to a password. It is associated with your user identity for use across all spaces and projects in Amazon CodeCatalyst. You use PATs to access CodeCatalyst from resources that include integrated development environments (IDEs) and Git-based source repositories. PATs represent you in Amazon CodeCatalyst and you can manage them in your user settings.For more information, see Managing personal access tokens in Amazon CodeCatalyst.

Request Syntax

PUT /v1/accessTokens HTTP/1.1 Content-type: application/json { "expiresTime": "string", "name": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

expiresTime

The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.

Type: Timestamp

Required: No

name

The friendly name of the personal access token.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Required: Yes

Response Syntax

HTTP/1.1 201 Content-type: application/json { "accessTokenId": "string", "expiresTime": "string", "name": "string", "secret": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

accessTokenId

The system-generated unique ID of the access token.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 36.

expiresTime

The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in RFC 3339. If not specified, the default is one year from creation.

Type: Timestamp

name

The friendly name of the personal access token.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

secret

The secret value of the personal access token.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 4000.

Errors

AccessDeniedException

The request was denied because you don't have sufficient access to perform this action. Verify that you are a member of a role that allows this action.

HTTP Status Code: 403

ConflictException

The request was denied because the requested operation would cause a conflict with the current state of a service resource associated with the request. Another user might have updated the resource. Reload, make sure you have the latest data, and then try again.

HTTP Status Code: 409

ResourceNotFoundException

The request was denied because the specified resource was not found. Verify that the spelling is correct and that you have access to the resource.

HTTP Status Code: 404

ServiceQuotaExceededException

The request was denied because one or more resources has reached its limits for the tier the space belongs to. Either reduce the number of resources, or change the tier if applicable.

HTTP Status Code: 402

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429

ValidationException

The request was denied because an input failed to satisfy the constraints specified by the service. Check the spelling and input requirements, and then try again.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: