Skip to content
API Reference

Create application

client.zones.applications.create(stringzoneID, ApplicationCreateParams { identifier, name, dependencies, 3 more } body, RequestOptionsoptions?): Application { id, created_at, dependencies_count, 10 more }
POST/zones/{zoneId}/applications

Creates a new Application - a software system with an identity that can access Resources

ParametersExpand Collapse
zoneID: string
body: ApplicationCreateParams { identifier, name, dependencies, 3 more }
identifier: string

User specified identifier, unique within the zone

minLength1
maxLength2048
name: string

Human-readable name

minLength1
maxLength255
dependencies?: Array<Dependency>

Dependencies of the application

id: string

Resource identifier

type?: string
description?: string | null

Human-readable description

maxLength2048
metadata?: Metadata { docs_url }

Entity metadata

docs_url?: string

Documentation URL

formaturi
maxLength2048
protocols?: Protocols

Protocol-specific configuration for application creation

oauth2?: Oauth2 { post_logout_redirect_uris, redirect_uris }

OAuth 2.0 protocol configuration for application creation

post_logout_redirect_uris?: Array<string>

OAuth 2.0 post-logout redirect URIs for this application

redirect_uris?: Array<string>

OAuth 2.0 redirect URIs for this application

ReturnsExpand Collapse
Application { id, created_at, dependencies_count, 10 more }

An Application is a software system with an associated identity that can access Resources. It may act on its own behalf (machine-to-machine) or on behalf of a user (delegated access).

id: string

Unique identifier of the application

created_at: string

Entity creation timestamp

formatdate-time
dependencies_count: number

Number of resource dependencies

identifier: string

User specified identifier, unique within the zone

minLength1
maxLength2048
name: string

Human-readable name

minLength1
maxLength255
organization_id: string

Organization that owns this application

owner_type: "platform" | "customer"

Who owns this application. Platform-owned applications cannot be modified via API.

Accepts one of the following:
"platform"
"customer"
slug: string

URL-safe identifier, unique within the zone

minLength1
maxLength63
updated_at: string

Entity update timestamp

formatdate-time
zone_id: string

Zone this application belongs to

description?: string | null

Human-readable description

maxLength2048
metadata?: Metadata { docs_url }

Entity metadata

docs_url?: string

Documentation URL

formaturi
maxLength2048
protocols?: Protocols | null

Protocol-specific configuration

oauth2?: Oauth2 | null

OAuth 2.0 protocol configuration

post_logout_redirect_uris?: Array<string> | null

OAuth 2.0 post-logout redirect URIs for this application

redirect_uris?: Array<string> | null

OAuth 2.0 redirect URIs for this application

Create application

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const application = await client.zones.applications.create('zoneId', {
  identifier: 'x',
  name: 'x',
});

console.log(application.id);
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "dependencies_count": 0,
  "identifier": "x",
  "name": "x",
  "organization_id": "organization_id",
  "owner_type": "platform",
  "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"
      ]
    }
  }
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "dependencies_count": 0,
  "identifier": "x",
  "name": "x",
  "organization_id": "organization_id",
  "owner_type": "platform",
  "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"
      ]
    }
  }
}