Update an API key

This endpoint updates the description, note, type, or scopes of an existing API key in your partner account.

❗️

Not yet available

PUT /v1/api-keys/{id} returns 404 in Sandbox and Production until the endpoint is enabled on the FlexFactor API. This page describes the request and response the endpoint uses once it is enabled. This page is hidden until then.




Request

Endpoint

EnvironmentHTTP MethodEndpoint
Sandbox testingPUThttps://api-sandbox.flexfactor.io/v1/api-keys/{id}
Production environmentPUThttps://api.flexfactor.io/v1/api-keys/{id}

Required Key

FieldDescription
{id}Path parameter. The id (GUID) of the API key, as returned by List of API keys.
bearer tokenThe authentication token returned by /oauth2/token for your partner credentials. The token needs the api-client.manage scope.

Request Body

Send only the fields you want to change. A field you leave out keeps its current value.

Field NameField TypeRequiredDescription
descriptionStringoptionalThe key's description. 1 to 255 characters.
noteStringoptionalThe key's note. Up to 500 characters.
typeStringoptionalThe key's type label. Up to 50 characters.
scopesArray of StringsoptionalScope IDs (GUID). The list replaces every scope on the key's API client.
❗️

Rotation is not supported

This endpoint does not generate a new key value. To replace a merchant's credentials, call Create an API key with overwriteExistingKey set to true.


Response

A successful request returns 200 OK with the standard envelope. The response does not echo the updated key; read it with List of API keys.

Field Definitions

Field NameField TypeField Explanation
successBooleantrue when the update was applied.
resultStringnull on this endpoint.
statusStringnull on this endpoint.
statusCodeStringnull on this endpoint. It is not the HTTP status code.
errorsArrayEmpty on success.
customPropertiesObjectEmpty on this endpoint.

HTTP status codes

SituationHTTPBody
Key updated, or nothing to change200The envelope with success: true
A field fails validation400Validation problem details — see Error Handling
No key matches {id} in your partner account400Validation problem details with the message API key not found or access denied
The bearer token is not a partner token400The message Partner ID not found in token claims
Missing, invalid, or expired bearer token401—
The token does not carry the api-client.manage scope403—
{id} is not a GUID404—

Example Payloads

Request

cURL Request Example (Update Only)

curl --request PUT \
     --url https://api-sandbox.flexfactor.io/v1/api-keys/{id} \
     --header 'Authorization: Bearer {the token returned by /oauth2}' \
     --header 'Content-Type: application/json' \
     --data '{
       "description": "Updated API Key Name",
       "note": "Owned by the platform team"
     }'

Response

Example for a Successful Update

{
   "success": true,
   "result": null,
   "status": null,
   "statusCode": null,
   "errors": [],
   "customProperties": {}
}

Example for Handling Errors

Key Not Found

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json

{
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "": [
      "API key not found or access denied"
    ]
  }
}

Invalid Credentials

If the bearer token is missing, invalid, or expired, the API returns a 401 error with an empty body.


Did this page help you?