Create personal access token
Creates a new Personal Access Token (PAT) for the authenticated user. PATs can be assigned specific permissions, enabling granular control over what automated processes are allowed to do on the user's behalf.
- HTTP request
- POST /auth/pats
- Authorization requirements
-
Header Type Required Description Authorizationstring Yes Bearer token used to authenticate the request. See Authentication flows for instructions on generating this token. X-DFNS-USERACTIONstring Yes User action signature used to authorize change-inducing requests. See User Action Signing flows for instructions on generating this signature. - Request body
-
Field Type Required namestring Yes publicKeystring Yes permissionIdstring No externalIdstring No daysValidinteger No secondsValidinteger No curl --request POST \ --url https://api.digitalassets.ibm.com/auth/pats \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-DFNS-USERACTION: <api-key>' \ --data ' { "name": "<string>", "publicKey": "<string>", "permissionId": "<string>", "externalId": "<string>", "daysValid": 123, "secondsValid": 123 } ' - Response
- 200: Success
Returns details about the new Personal Access Token.
Example response:
{ "accessToken": "<string>", "dateCreated": "<string>", "credId": "<string>", "isActive": true, "kind": "Pat", "linkedUserId": "<string>", "linkedAppId": "<string>", "name": "<string>", "orgId": "<string>", "publicKey": "<string>", "tokenId": "<string>", "permissionAssignments": [ { "permissionName": "<string>", "permissionId": "<string>", "assignmentId": "<string>", "operations": [ "<string>" ] } ] }