API7 Docs
API7 GatewayAPI7 Enterprise Developer Portal APIsCreate an application credential

Create an application credential

POST /api/applications/{application_id}/credentials

POST /api/applications/{application_id}/credentials

Interactive request editor loads with JavaScript.

Authorization

BearerAuth DeveloperIDHeader
AuthorizationBearer <token>

In: header

X-Portal-Developer-ID<token>

In: header

Path Parameters

application_id*string

The object ID.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256
Default"default"

Request Body

application/json

Create an application credential request.

Create a Key Auth application credential request.

Response Body

application/json

application/json

application/json

curl -X POST "$API_BASE_URL/api/applications/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101/credentials" \  -H "Content-Type: application/json" \  -d '{    "type": "key-auth",    "name": "us-west-rsc"  }'

{
  "application_id": "default",
  "application_name": "us-west-rsc",
  "desc": "Object description.",
  "labels": {
    "version": "v2",
    "env": "prod"
  },
  "type": "key-auth",
  "name": "us-west-rsc",
  "key-auth": {
    "key": "string"
  },
  "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
  "created_at": "2025-01-01T00:00:00.000Z",
  "updated_at": "2025-01-01T00:00:00.000Z"
}
Complete operation details and schema variants

POST /api/applications/{application_id}/credentials

Create an application credential

Parameters

  • application_id (path, string, required):

Request body

Content type: application/json

  • oneOf variant 1
  • allOf variant 1
  • desc (string, optional): The object description.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • type (string, required): The credential type.
  • name (string, required): The object name.
  • key-auth (object,null, optional): Key Auth configuration. If null, key will be auto-generated.
  • oneOf variant 2
  • allOf variant 1
  • desc (string, optional): The object description.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • type (string, required): The credential type.
  • name (string, required): The object name.
  • basic-auth (object, required):
  • basic-auth.username (string, required): Username.
  • basic-auth.password (string, required): User password.
  • oneOf variant 3
  • allOf variant 1
  • desc (string, optional): The object description.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • type (string, required): The credential type.
  • oauth (object, required):
  • oauth.dcr_provider_id (string, required): The DCR provider ID.
  • oauth.redirect_uris (array, optional): The redirect URIs.

Responses

  • 201:
  • allOf variant 1
  • oneOf variant 1
  • allOf variant 1
  • application_id (string, required): Application ID.
  • application_name (string, required): The object name.
  • desc (string, optional): The object description.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • type (string, required): The credential type.
  • name (string, required): The object name.
  • key-auth (object, optional): Key Auth configuration.
  • key-auth.key (string, optional): The key is only returned upon creation or regeneration.
  • oneOf variant 2
  • allOf variant 1
  • application_id (string, required): Application ID.
  • application_name (string, required): The object name.
  • desc (string, optional): The object description.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • type (string, required): The credential type.
  • name (string, required): The object name.
  • basic-auth (object, optional): Basic Auth configuration.
  • basic-auth.username (string, optional): The username.
  • basic-auth.password (string, optional): The password is only returned upon creation or regeneration.
  • oneOf variant 3
  • allOf variant 1
  • application_id (string, required): Application ID.
  • application_name (string, required): The object name.
  • desc (string, optional): The object description.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • type (string, required): The credential type.
  • oauth (object, required):
  • oauth.dcr_provider_id (string, required): The DCR provider ID.
  • oauth.dcr_provider (object, optional):
  • oauth.dcr_provider.id (string, required): The object ID.
  • oauth.dcr_provider.name (string, required): The name of the Dynamic Client Registration (DCR) Provider.
  • oauth.dcr_provider.provider_type (string, optional): The type of DCR provider.
  • oauth.dcr_provider.issuer (string, required): The issuer URL of the Authorization Server.
  • oauth.client_id (string, required): The client ID.
  • oauth.client_secret (string, optional): The client secret is only returned upon creation or regeneration.
  • oauth.redirect_uris (array, optional): The redirect URIs.
  • allOf variant 2
  • id (string, required): The object ID.
  • created_at (string, required): The time when the object was created in ISO 8601 format.
  • updated_at (string, required): The time when the object was last updated in ISO 8601 format.
  • 400: Bad request.
  • status (integer, required): The HTTP status code of the error response.
  • message (string, required): The error message.
  • 401: Unauthorized. Response fields (application/json): identical to POST /api/applications/{application_id}/credentials, response 400 above.
  • 500: Internal server error.

cURL

curl -X POST '$API_BASE_URL/api/applications/{application_id}/credentials'