Description

Use a HTTP POST request to create a JWT tokens user credential.

Request

HTTP Method: POST

Parameter Description
name Name of the user credential.
mode Describes the type of credential (JWT)
jwt_algorithm The algorithm to be used when computing the JWT
jwt_payload The payload to be included in the JWT
jwt_auto_generate_time_claims Auto generate ‘iat’ & ‘exp’ claims
jwt_private_key The private key to be used to sign the JWT
team_id ID of Tines Team where the user credential will be located.
folder_id Optional ID of folder to which the user credential will be located

Sample request

curl -X POST \
  https://<tenant-name>.tines.io/api/v1/user_credentials \
  -H 'content-type: application/json' \
  -H 'x-user-email: <email-address>' \
  -H 'x-user-token: <api-token>' \
  -d '{
        "name": "foo",
        "value": "bar",
        "mode": "JWT",
        "team_id": 2,
        "jwt_algorithm": "rsa256",
        "jwt_payload": "",
        "jwt_auto_generate_time_claims": true,
        "jwt_private_key": "<private-key>",
    }'

Response

A successful request will return a JSON object describing the created credential.

Field description

Parameter Description
id User credential ID.
name Name of the user credential.
mode Describes the type of credential (TEXT, JWT, OAUTH, AWS, MTLS, HTTP_REQUEST_AGENT)
team_id ID of team to which the user credential belongs.
folder_id ID of folder to which the user credential belongs.
created_at ISO 8601 Timestamp representing date and time the credential was created.
updated_at ISO 8601 Timestamp representing date and time the credential was last updated.

Sample response

{
  "id": 1,
  "name": "tines_api_credential",
  "mode": "JWT",
  "team_id": 2,
  "folder_id": 1,
  "created_at": "2021-03-26T12:34:16.540Z",
  "updated_at": "2021-03-26T12:34:16.540Z"
}