Skip to main content

Update

Description

Use a HTTP POST request to update a credential.

Request

HTTP Method: PUT

ParameterDescription
modeDescribes the type of credential (TEXT, JWT, OAUTH, AWS, MTLS, HTTP_REQUEST_AGENT)
nameOptional Name of the credential.
folder_idOptional ID of folder to which the credential will be located
read_accessOptional Control where this credential can be used (TEAM, GLOBAL). default: TEAM
descriptionOptional Description of the credential. default: "" (empty string).

TEXT Options

ParameterDescription
valueValue of the credential.

OAUTH Options

ParameterDescription
oauth_urlYour app oauth url
oauth_token_urlYour app oauth token url
oauth_client_idThe client ID for your app
oauth_client_secretThe client secret for your app
oauth_scopeEnter one or more scope values indicating which parts of the user’s account you wish to access
oauth_grant_typeTines supports client_credentials and authorization_code grants.

MTLS Options

ParameterDescription
mtls_client_certificateThe certificate file issued by the CA for this client
mtls_client_private_keyThe private key file for the client certificate
mtls_root_certificateThe root certificate file for the certificate authority (CA) responsible for signatures

JWT Options

ParameterDescription
jwt_algorithmThe algorithm to be used when computing the JWT
jwt_payloadThe payload to be included in the JWT
jwt_auto_generate_time_claimsAuto generate ‘iat’ & ‘exp’ claims
jwt_private_keyThe private key to be used to sign the JWT

HTTP_REQUEST_AGENT Options

ParameterDescription
http_request_optionsJSON string representing the Agents::HTTPRequestAgent Options
http_request_location_of_tokenLocation of token from response

AWS Options

ParameterDescription
aws_authentication_typeThe authentication method with AWS, key-based-access or role-based-access(KEY,ROLE)
aws_access_keyThe access key from your AWS Security Credentials
aws_secret_keyThe access secret from your AWS Security Credentials
aws_assumed_role_arnRequired for role-based-access The ARN of the role you wish to assume, e.g.: arn:aws:iam::123456789012:role/write-access-role
aws_assumed_role_external_idOptional The external ID to be used when making the request

Sample request

curl -X PUT \
https://<tenant-domain>/api/v1/user_credentials/<credential-id> \
-H 'content-type: application/json' \
-H 'x-user-email: <email-address>' \
-H 'x-user-token: <api-token>' \
-d '{
"name": "foo",
"value": "bar",
"mode": "TEXT"
}'

Response

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

Field description

ParameterDescription
idcredential ID.
nameName of the credential.
modeDescribes the type of credential (TEXT, JWT, OAUTH, AWS, MTLS, HTTP_REQUEST_AGENT)
team_idID of team to which the credential belongs.
folder_idID of folder to which the credential belongs.
read_accessControl where this credential can be used.
descriptionDescription of the credential.
slugAn underscored representation of the credential name
created_atISO 8601 Timestamp representing date and time the credential was created.
updated_atISO 8601 Timestamp representing date and time the credential was last updated.

Sample response

{
"id": 1,
"name": "tines_api_credential",
"mode": "TEXT",
"team_id": 2,
"folder_id": 1,
"read_access": "TEAM",
"slug": "tines_api_credential",
"created_at": "2021-03-26T12:34:16.540Z",
"updated_at": "2021-03-26T12:34:16.540Z",
"description": ""
}