---
descriptions:
  delete_resource_by_external_id:
    organization_id: The ID of the organization.
    resource_type_slug: The slug of the resource type.
    external_id: The external ID of the resource.
    cascade_delete: >-
      If true, deletes all descendant resources and role assignments. Defaults
      to false. If not set and the resource has children or assignments, the
      request will fail.
reference:
  curl:
    - key: delete_resource_by_external_id
      id: delete_resource_by_external_id
      url: /reference/fga/resource/delete-by-external-id
      title: >-
        /authorization/organizations/:organization_id/resources/:resource_type_slug/:external_id
      type: DELETE
      parameters:
        - key: organization_id
          type: string
          description: (delete_resource_by_external_id.organization_id)
        - key: resource_type_slug
          type: string
          description: (delete_resource_by_external_id.resource_type_slug)
        - key: external_id
          type: string
          description: (delete_resource_by_external_id.external_id)
        - key: cascade_delete
          type: boolean
          optional: true
          description: (delete_resource_by_external_id.cascade_delete)
      returns:
        - key: empty
          type: empty
          description: Returns an empty response on success.
  js:
    - key: deleteResourceByExternalId
      id: delete_resource_by_external_id
      url: /reference/fga/resource/delete-by-external-id
      title: authorization.deleteResourceByExternalId()
      parameters:
        - key: options
          type: object
          unwrap: true
          properties:
            - key: organizationId
              type: string
              description: (delete_resource_by_external_id.organization_id)
            - key: resourceTypeSlug
              type: string
              description: (delete_resource_by_external_id.resource_type_slug)
            - key: externalId
              type: string
              description: (delete_resource_by_external_id.external_id)
            - key: cascadeDelete
              type: boolean
              optional: true
              description: (delete_resource_by_external_id.cascade_delete)
      returns:
        - key: void
          description: Returns nothing on success.
originalPath: >-
  .tmp-workos-clone/packages/docs/content/reference/fga/resource/delete-by-external-id.mdx
---

## Delete a resource by external ID

Delete an authorization resource using its external ID. By default, this will fail if the resource has child resources or role assignments. Set `cascade_delete` to `true` to delete the resource along with all its descendants and role assignments.

<Callout type="warning">
  Deleting a resource also removes all role assignments on that resource. This
  action cannot be undone.
</Callout>

<CodeBlock referenceId="delete_resource_by_external_id">
  <CodeBlockTab title="Request" file="delete-resource-by-external-id-request" />
</CodeBlock>
