Skip to content
API Reference

Create application

client.Zones.Applications.New(ctx, zoneID, body) (*Application, error)
POST/zones/{zoneId}/applications

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

ParametersExpand Collapse
zoneID string
body ZoneApplicationNewParams
Identifier param.Field[string]

User specified identifier, unique within the zone

minLength1
maxLength2048
Name param.Field[string]

Human-readable name

minLength1
maxLength255
Dependencies param.Field[[]ZoneApplicationNewParamsDependency]optional

Dependencies of the application

ID string

Resource identifier

Type stringoptional
Description param.Field[string]optional

Human-readable description

maxLength2048
Metadata param.Field[Metadata]optional

Entity metadata

Protocols param.Field[ZoneApplicationNewParamsProtocols]optional

Protocol-specific configuration for application creation

Oauth2 ZoneApplicationNewParamsProtocolsOauth2optional

OAuth 2.0 protocol configuration for application creation

PostLogoutRedirectUris []stringoptional

OAuth 2.0 post-logout redirect URIs for this application

RedirectUris []stringoptional

OAuth 2.0 redirect URIs for this application

ReturnsExpand Collapse
type Application struct{…}

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

CreatedAt Time

Entity creation timestamp

formatdate-time
DependenciesCount int64

Number of resource dependencies

Identifier string

User specified identifier, unique within the zone

minLength1
maxLength2048
Name string

Human-readable name

minLength1
maxLength255
OrganizationID string

Organization that owns this application

OwnerType ApplicationOwnerType

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

Accepts one of the following:
const ApplicationOwnerTypePlatform ApplicationOwnerType = "platform"
const ApplicationOwnerTypeCustomer ApplicationOwnerType = "customer"
Slug string

URL-safe identifier, unique within the zone

minLength1
maxLength63
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this application belongs to

Description stringoptional

Human-readable description

maxLength2048
Metadata Metadataoptional

Entity metadata

DocsURL stringoptional

Documentation URL

formaturi
maxLength2048
Protocols ApplicationProtocolsoptional

Protocol-specific configuration

Oauth2 ApplicationProtocolsOauth2optional

OAuth 2.0 protocol configuration

PostLogoutRedirectUris []stringoptional

OAuth 2.0 post-logout redirect URIs for this application

RedirectUris []stringoptional

OAuth 2.0 redirect URIs for this application

Create application

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
)

func main() {
  client := keycard.NewClient(

  )
  application, err := client.Zones.Applications.New(
    context.TODO(),
    "zoneId",
    keycard.ZoneApplicationNewParams{
      Identifier: "x",
      Name: "x",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
      ]
    }
  }
}