> ## Documentation Index
> Fetch the complete documentation index at: https://conductorone-docs-mcp-bridge-private-server.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Schema

> GetSchema returns the field-by-field Terraform mapping for one C1
 API object type. Cacheable by (object_fqn, block_kind,
 provider_version).



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples get /api/v1/terraform-export/schema
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/terraform-export/schema:
    get:
      tags:
        - Terraform Export
      summary: Get Schema
      description: |-
        GetSchema returns the field-by-field Terraform mapping for one C1
         API object type. Cacheable by (object_fqn, block_kind,
         provider_version).
      operationId: c1.api.terraform_export.v1.TerraformExportService.GetSchema
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.terraform_export.v1.GetSchemaResponse
          description: Successful response
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: >-
            import { ConductoroneSDKTypescript } from
            "conductorone-sdk-typescript";


            const conductoroneSDKTypescript = new ConductoroneSDKTypescript({
              security: {
                bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
                oauth: "<YOUR_OAUTH_HERE>",
              },
            });


            async function run() {
              const result = await conductoroneSDKTypescript.terraformExport.getSchema();

              console.log(result);
            }


            run();
components:
  schemas:
    c1.api.terraform_export.v1.GetSchemaResponse:
      description: The GetSchemaResponse message.
      properties:
        schema:
          oneOf:
            - $ref: '#/components/schemas/c1.api.terraform_export.v1.TFSchemaMapping'
            - type: 'null'
      title: Get Schema Response
      type: object
      x-speakeasy-name-override: GetSchemaResponse
    c1.api.terraform_export.v1.TFSchemaMapping:
      description: >
        TFSchemaMapping describes how to translate one C1 API object into a
         single Terraform block. Variant-specific metadata (e.g. `import_id` for
         resources) lives on the `block` oneof.

        This message contains a oneof named block. Only a single field of the
        following list may be set at a time:
          - resource
          - dataSource
      properties:
        dataSource:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.terraform_export.v1.TFSchemaMapping.DataSource
            - type: 'null'
        fields:
          description: |-
            Per-attribute mapping. Order matches the provider schema; preserve
             it when emitting for stable output.
          items:
            $ref: '#/components/schemas/c1.api.terraform_export.v1.TFFieldMapping'
          type:
            - array
            - 'null'
        providerVersion:
          description: |-
            The conductorone provider version this schema was derived from
             (e.g. "1.0.40").
          type:
            - string
            - 'null'
        refererShapes:
          description: |-
            The set of distinct composite-key-field shapes that consumers
             declare when referencing this target via a TFReference. Used by
             the FE multi-root producer to enumerate canonical lookup keys for
             its `addressByImportId` registration so cross-root references
             collapse correctly to direct expressions regardless of which
             consumer site does the lookup.

             Each entry is one distinct shape (one `CompositeKeyFieldSet`
             with non-empty `fields`). The single-id (bare-id) form is
             implicit and is NOT represented here — every producer registers
             under `canonicalRefKey(id, {})` unconditionally as a baseline.

             Computed at schema-load time from `references_table.go` by
             grouping consumer-site `composite_key_fields` declarations
             by target tf_type and de-duplicating distinct shapes. Targets
             with no composite-key consumers (User, Policy, App today)
             ship an empty list.
          items:
            $ref: >-
              #/components/schemas/c1.api.terraform_export.v1.CompositeKeyFieldSet
          type:
            - array
            - 'null'
        resource:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.terraform_export.v1.TFSchemaMapping.Resource
            - type: 'null'
        tfTypeName:
          description: |-
            The Terraform type identifier — the string immediately after the
             `resource` or `data` keyword in HCL (e.g. "conductorone_app").
          type:
            - string
            - 'null'
      title: Tf Schema Mapping
      type: object
      x-speakeasy-name-override: TFSchemaMapping
    c1.api.terraform_export.v1.TFSchemaMapping.DataSource:
      description: |-
        Data-source-specific schema metadata. Reserved for future use; empty
         in v1.
      title: Data Source
      type: object
      x-speakeasy-name-override: DataSource
    c1.api.terraform_export.v1.TFFieldMapping:
      description: |-
        TFFieldMapping describes how one field of a C1 API object maps to one
         attribute of a Terraform block.
      properties:
        c1Field:
          description: The C1 API field name (proto field name, snake_case).
          type:
            - string
            - 'null'
        computed:
          description: |-
            Whether the server populates this field. A field that is
             `computed` and neither `optional` nor `required` is server-only —
             do not emit it in user-authored HCL.
          type:
            - boolean
            - 'null'
        elementTfType:
          description: |-
            For collection fields (list/set/tuple/map) whose elements are
             primitives (string/number/bool), the TF type of those elements.
             TF_TYPE_UNSPECIFIED for non-collection fields and for collections
             of objects (where `nested_fields` describes the element shape).
          enum:
            - TF_TYPE_UNSPECIFIED
            - TF_TYPE_STRING
            - TF_TYPE_NUMBER
            - TF_TYPE_BOOL
            - TF_TYPE_LIST
            - TF_TYPE_SET
            - TF_TYPE_MAP
            - TF_TYPE_OBJECT
            - TF_TYPE_TUPLE
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        enumValues:
          description: |-
            Declared variants for fields whose C1-side proto type is an enum.
             Empty for non-enum fields. The conductorone provider accepts the
             full proto enum name as a quoted string (e.g.
             `policy_type = "POLICY_TYPE_GRANT"`); emit `EnumValue.name` as the
             literal value.
          items:
            $ref: '#/components/schemas/c1.api.terraform_export.v1.EnumValue'
          type:
            - array
            - 'null'
        nestedFields:
          description: |-
            For object-typed fields and list/set/tuple fields whose elements
             are objects, the shape of the nested attributes. Empty for
             primitive scalars and primitive-element collections.
          items:
            $ref: '#/components/schemas/c1.api.terraform_export.v1.TFFieldMapping'
          type:
            - array
            - 'null'
        oneofField:
          description: |-
            When this Terraform attribute corresponds to one variant of a
             proto `oneof`, `oneof_field` names the proto oneof and
             `oneof_variant` names the active case. Both unset for regular
             (non-oneof) fields, which is the common case.

             Example: a oneof `target` with variant `automation` on message
             `Action` exposed as the TF attribute `action_target_automation`:

               oneof_field   = "target"
               oneof_variant = "automation"
          type:
            - string
            - 'null'
        oneofVariant:
          description: The oneofVariant field.
          type:
            - string
            - 'null'
        optional:
          description: |-
            Whether the user may supply this field. May co-occur with
             `computed` (i.e. either the user or the server can set the value).
          type:
            - boolean
            - 'null'
        references:
          oneOf:
            - $ref: '#/components/schemas/c1.api.terraform_export.v1.TFReference'
            - type: 'null'
        required:
          description: Whether the user must supply this field in HCL.
          type:
            - boolean
            - 'null'
        sensitive:
          description: |-
            Whether the value is a secret. Sensitive values must not be
             rendered verbatim; emit a placeholder so callers wire the value
             through a Terraform variable or vault data source.
          type:
            - boolean
            - 'null'
        tfField:
          description: |-
            The Terraform attribute name. Usually matches c1_field but may
             differ in casing or pluralization.
          type:
            - string
            - 'null'
        tfType:
          description: |-
            The Terraform attribute type. For collections of structured
             objects, the element shape is in `nested_fields`. For collections
             of primitives, the element type is in `element_tf_type`.
          enum:
            - TF_TYPE_UNSPECIFIED
            - TF_TYPE_STRING
            - TF_TYPE_NUMBER
            - TF_TYPE_BOOL
            - TF_TYPE_LIST
            - TF_TYPE_SET
            - TF_TYPE_MAP
            - TF_TYPE_OBJECT
            - TF_TYPE_TUPLE
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
      title: Tf Field Mapping
      type: object
      x-speakeasy-name-override: TFFieldMapping
    c1.api.terraform_export.v1.CompositeKeyFieldSet:
      description: |-
        CompositeKeyFieldSet groups a non-empty set of composite-key
         fields as declared by one or more consumer reference sites that
         target the same Terraform type. Used in `TFSchemaMapping
         .referer_shapes` (the "inverted index" of composite-key shapes
         targeting this kind) so a multi-root producer can register
         canonical lookup keys for every shape its consumers might
         compute.

         Invariant: `fields` MUST be non-empty. The bare-id (single-id)
         form is implicit — every producer registers under
         `canonicalRefKey(id, {})` unconditionally, and consumer sites
         with empty composite_key_fields are not represented here. The
         backend's inverted-index computation skips them; including an
         empty `fields` would just round-trip to the bare-id form and
         produce a duplicate registration.
      properties:
        fields:
          description: The fields field.
          items:
            $ref: '#/components/schemas/c1.api.terraform_export.v1.CompositeKeyField'
          type:
            - array
            - 'null'
      title: Composite Key Field Set
      type: object
      x-speakeasy-name-override: CompositeKeyFieldSet
    c1.api.terraform_export.v1.TFSchemaMapping.Resource:
      description: Resource-specific schema metadata.
      properties:
        importId:
          oneOf:
            - $ref: '#/components/schemas/c1.api.terraform_export.v1.ImportIDShape'
            - type: 'null'
      title: Resource
      type: object
      x-speakeasy-name-override: Resource
    c1.api.terraform_export.v1.EnumValue:
      description: EnumValue is one declared variant of a proto enum.
      properties:
        name:
          description: |-
            Full proto enum value name (e.g. "POLICY_TYPE_GRANT"). The
             conductorone provider accepts this verbatim as a quoted-string HCL
             literal.
          type:
            - string
            - 'null'
        number:
          description: |-
            Proto enum number — the value on the wire (e.g. 1 for
             POLICY_TYPE_GRANT).
          format: int32
          type:
            - integer
            - 'null'
      title: Enum Value
      type: object
      x-speakeasy-name-override: EnumValue
    c1.api.terraform_export.v1.TFReference:
      description: |-
        TFReference describes the Terraform type(s) an ID-shaped field may
         reference, plus any sibling fields needed to disambiguate a
         composite-key lookup.

         `tf_type_names` covers the polymorphic / preferred-default
         dimension. `composite_key_fields` covers the multi-key dimension —
         some referents can't be resolved with a single id (every
         `conductorone_app_entitlement` lookup needs `(app_id, id)`,
         every `conductorone_app_entitlement_user_binding` needs three
         keys, etc.).
      properties:
        compositeKeyFields:
          description: |-
            Sibling fields on the SAME parent message whose runtime values
             must be paired with this reference's id to look the referent up
             via its Terraform data source.

             Examples (each entry's c1_field is the C1 proto field name on
             the parent message; tf_field is the attribute name in the data
             source's `refs[]` struct):

               `AppEntitlementAutomation.app_entitlement_id` →
                 `[{c1_field: "app_id", tf_field: "app_id"}]`  (2 keys total)

               `AppEntitlementUserBinding.app_user_id` →
                 `[{c1_field: "app_id",             tf_field: "app_id"},
                   {c1_field: "app_entitlement_id", tf_field: "app_entitlement_id"}]`
                 (3 keys total)

               `AppResourceOwner.user_id` →
                 `[{c1_field: "app_id",               tf_field: "app_id"},
                   {c1_field: "app_resource_type_id", tf_field: "app_resource_type_id"},
                   {c1_field: "app_resource_id",      tf_field: "app_resource_id"}]`
                 (4 keys total)

             The reference id field itself is always emitted as `id` in the
             data source's ref struct (provider convention) — it is NOT
             re-listed here.

             Empty/unset means single-id lookup is sufficient (User, Policy,
             App today). Mirrors `ImportIDShape.Composite.fields`'s
             structured shape.
          items:
            $ref: '#/components/schemas/c1.api.terraform_export.v1.CompositeKeyField'
          type:
            - array
            - 'null'
        tfTypeNames:
          description: |-
            Candidate Terraform types this field may reference. The first
             entry is the preferred default when no other signal disambiguates.
             Empty means the field is not a reference.
          items:
            type: string
          type:
            - array
            - 'null'
      title: Tf Reference
      type: object
      x-speakeasy-name-override: TFReference
    c1.api.terraform_export.v1.CompositeKeyField:
      description: |-
        CompositeKeyField names one sibling component of a composite-key
         reference lookup.
      properties:
        c1Field:
          description: |-
            C1 API field name on the parent message (snake_case proto
             field). The collector reads the runtime value at this path.
          type:
            - string
            - 'null'
        tfField:
          description: |-
            Attribute name in the Terraform data source's `refs[]` struct.
             Usually identical to c1_field (the conductorone provider
             matches them 1:1 today). Distinct fields anyway so a future
             provider rename is wire-safe — no migration needed.
          type:
            - string
            - 'null'
      title: Composite Key Field
      type: object
      x-speakeasy-name-override: CompositeKeyField
    c1.api.terraform_export.v1.ImportIDShape:
      description: >
        ImportIDShape describes the structure of the `id` value in a
         Terraform `import { to = ..., id = "..." }` block. Most resources use
         a single string; binding-style resources (App_Owner,
         App_Entitlement_Owner, …) use a composite of multiple field values.

        This message contains a oneof named shape. Only a single field of the
        following list may be set at a time:
          - singleString
          - composite
      properties:
        composite:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.terraform_export.v1.ImportIDShape.Composite
            - type: 'null'
        singleString:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.terraform_export.v1.ImportIDShape.SingleString
            - type: 'null'
      title: Import Id Shape
      type: object
      x-speakeasy-name-override: ImportIDShape
    c1.api.terraform_export.v1.ImportIDShape.Composite:
      description: |-
        Composite import IDs combine values from multiple component fields
         per the declared `format`.
      properties:
        fields:
          description: |-
            Component fields, in the order they participate in the import
             ID.
          items:
            $ref: >-
              #/components/schemas/c1.api.terraform_export.v1.ImportIDShape.CompositeField
          type:
            - array
            - 'null'
        format:
          description: |-
            Wire format the provider expects. Defaults to
             FORMAT_JSON_OBJECT.
          enum:
            - FORMAT_JSON_OBJECT
            - FORMAT_COLON_SEPARATED
            - FORMAT_UNDERSCORE_SEPARATED
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
      title: Composite
      type: object
      x-speakeasy-name-override: Composite
    c1.api.terraform_export.v1.ImportIDShape.SingleString:
      description: Single-string import IDs use the resource's id value verbatim.
      title: Single String
      type: object
      x-speakeasy-name-override: SingleString
    c1.api.terraform_export.v1.ImportIDShape.CompositeField:
      description: CompositeField names one component of a composite import ID.
      properties:
        c1Field:
          description: The C1 API field whose value supplies this component.
          type:
            - string
            - 'null'
        tfType:
          description: The TF attribute type of the component value.
          enum:
            - TF_TYPE_UNSPECIFIED
            - TF_TYPE_STRING
            - TF_TYPE_NUMBER
            - TF_TYPE_BOOL
            - TF_TYPE_LIST
            - TF_TYPE_SET
            - TF_TYPE_MAP
            - TF_TYPE_OBJECT
            - TF_TYPE_TUPLE
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
      title: Composite Field
      type: object
      x-speakeasy-name-override: CompositeField
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````