Create resource
Create resource
Creates a new Resource - a system that exposes protected information or functionality requiring authentication
Path Parameters
Body ParametersJSON
User specified identifier, unique within the zone. Must not contain HTML tags (e.g. <script>, <div>) or control characters.
Human-readable name. Must not contain HTML tags (e.g. <script>, <div>) or control characters.
ID of the application that provides this resource
Credential lifetime override in seconds. When set, overrides the default credential lifetime for this resource.
ID of the credential provider to associate with the resource
Human-readable description. Must not contain HTML tags (e.g. <script>, <div>) or control characters.
When true, the resource identifier is treated as a URI prefix and protects all URLs that share the identifier as a prefix. Defaults to false: resources only match by exact identifier unless explicitly enabled.
Scopes supported by the resource
Returns
Create resource
curl https://api.keycard.ai/zones/$ZONE_ID/resources \
-H 'Content-Type: application/json' \
-d '{
"identifier": "x",
"name": "x"
}'{
"id": "id",
"application_type": "native",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"prefix": true,
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"application": {
"id": "id",
"consent": "implicit",
"created_at": "2019-12-27T18:11:19.117Z",
"dependencies_count": 0,
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"protocols": {
"oauth2": {
"post_logout_redirect_uris": [
"https://example.com"
],
"redirect_uris": [
"https://example.com"
]
}
}
},
"application_id": "application_id",
"credential_lifetime_seconds": 60,
"credential_provider": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"client_id": "client_id",
"client_secret_set": true,
"description": "description",
"metadata": {},
"protocols": {
"oauth2": {
"issuer": "https://example.com",
"authorization_endpoint": "https://example.com",
"authorization_parameters": {
"foo": "string"
},
"authorization_resource_enabled": true,
"authorization_resource_parameter": "authorization_resource_parameter",
"code_challenge_methods_supported": [
"string"
],
"jwks_uri": "https://example.com",
"registration_endpoint": "https://example.com",
"scope_parameter": "scope_parameter",
"scope_separator": "scope_separator",
"scopes_supported": [
"string"
],
"token_endpoint": "https://example.com",
"token_response_access_token_pointer": "token_response_access_token_pointer"
},
"openid": {
"scopes": [
"string"
],
"user_identifier_claim": "user_identifier_claim",
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"credential_provider_id": "credential_provider_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"scopes": [
"string"
],
"when_accessing": [
"string"
]
}Returns Examples
{
"id": "id",
"application_type": "native",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"prefix": true,
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"application": {
"id": "id",
"consent": "implicit",
"created_at": "2019-12-27T18:11:19.117Z",
"dependencies_count": 0,
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"protocols": {
"oauth2": {
"post_logout_redirect_uris": [
"https://example.com"
],
"redirect_uris": [
"https://example.com"
]
}
}
},
"application_id": "application_id",
"credential_lifetime_seconds": 60,
"credential_provider": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"client_id": "client_id",
"client_secret_set": true,
"description": "description",
"metadata": {},
"protocols": {
"oauth2": {
"issuer": "https://example.com",
"authorization_endpoint": "https://example.com",
"authorization_parameters": {
"foo": "string"
},
"authorization_resource_enabled": true,
"authorization_resource_parameter": "authorization_resource_parameter",
"code_challenge_methods_supported": [
"string"
],
"jwks_uri": "https://example.com",
"registration_endpoint": "https://example.com",
"scope_parameter": "scope_parameter",
"scope_separator": "scope_separator",
"scopes_supported": [
"string"
],
"token_endpoint": "https://example.com",
"token_response_access_token_pointer": "token_response_access_token_pointer"
},
"openid": {
"scopes": [
"string"
],
"user_identifier_claim": "user_identifier_claim",
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"credential_provider_id": "credential_provider_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"scopes": [
"string"
],
"when_accessing": [
"string"
]
}