---
descriptions:
  create_resource:
    external_id: >-
      An identifier you provide to reference the resource in your system. Must
      be unique within the organization and resource type.
    name: A human-readable name for the resource.
    description: An optional description for the resource.
    resource_type_slug: The slug of the resource type this resource belongs to.
    organization_id: The ID of the organization this resource belongs to.
    parent_resource_id: >-
      The ID of the parent resource. Use either this or
      parent_resource_external_id + parent_resource_type_slug.
    parent_resource_external_id: >-
      The external ID of the parent resource. Requires
      parent_resource_type_slug.
    parent_resource_type_slug: >-
      The resource type slug of the parent resource. Required with
      parent_resource_external_id.
reference:
  curl:
    - key: create_resource
      id: create_resource
      url: /reference/fga/resource/create
      title: /authorization/resources
      type: POST
      parameters:
        - key: external_id
          type: string
          description: (create_resource.external_id)
        - key: name
          type: string
          description: (create_resource.name)
        - key: description
          type: string
          optional: true
          description: (create_resource.description)
        - key: resource_type_slug
          type: string
          description: (create_resource.resource_type_slug)
        - key: organization_id
          type: string
          description: (create_resource.organization_id)
        - key: parent_resource_id
          type: string
          optional: true
          description: (create_resource.parent_resource_id)
        - key: parent_resource_external_id
          type: string
          optional: true
          description: (create_resource.parent_resource_external_id)
        - key: parent_resource_type_slug
          type: string
          optional: true
          description: (create_resource.parent_resource_type_slug)
      returns:
        - (resource)
  js:
    - key: createResource
      id: create_resource
      url: /reference/fga/resource/create
      title: authorization.createResource()
      parameters:
        - key: options
          type: object
          unwrap: true
          properties:
            - key: organizationId
              type: string
              description: (create_resource.organization_id)
            - key: resourceTypeSlug
              type: string
              description: (create_resource.resource_type_slug)
            - key: externalId
              type: string
              description: (create_resource.external_id)
            - key: name
              type: string
              description: (create_resource.name)
            - key: description
              type: string
              optional: true
              description: (create_resource.description)
            - key: parentResourceId
              type: string
              optional: true
              description: (create_resource.parent_resource_id)
            - key: parentResourceExternalId
              type: string
              optional: true
              description: (create_resource.parent_resource_external_id)
            - key: parentResourceTypeSlug
              type: string
              optional: true
              description: (create_resource.parent_resource_type_slug)
      returns:
        - key: AuthorizationResource
          description: (resource.self)
originalPath: .tmp-workos-clone/packages/docs/content/reference/fga/resource/create.mdx
---

## Create a resource

Create a new authorization resource. The resource is associated with an organization and resource type.

You can optionally specify a parent resource to place it in a hierarchy. The parent can be identified either by `parent_resource_id` or by the combination of `parent_resource_external_id` and `parent_resource_type_slug`.

<Callout type="info">
  The `external_id` must be unique within the organization and resource type
  combination.
</Callout>

<CodeBlock referenceId="create_resource">
  <CodeBlockTab title="Request" file="create-resource-request" />
  <CodeBlockTab title="Response" file="create-resource-response" />
</CodeBlock>
