---
title: "Metadata API endpoint"
method: POST
path: "/v1/metadata"
---

# Metadata API endpoint

`POST /v1/metadata`

Endpoint for all metadata operations

## Request body

- union
  - PgCreateInsertPermission
    - `type` 'pg_create_insert_permission', required — Type of operation
    - `args` InsertPermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `permission` object, required
        - `check` BoolExp, required — Boolean expression for filtering rows
        - `set` ColumnPresets — Column preset values
        - `columns` string[] — List of columns to allow inserting into
        - `backend_only` boolean — When set to true, the permission is only applied from trusted backends
      - `comment` string — Comment for the permission
      - `source` string, required — Name of the source database
  - PgDropInsertPermission
    - `type` 'pg_drop_insert_permission', required — Type of operation
    - `args` DropPermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `source` string, required — Name of the source database
  - PgCreateSelectPermission
    - `type` 'pg_create_select_permission', required — Type of operation
    - `args` SelectPermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `permission` object, required
        - `filter` BoolExp, required — Boolean expression for filtering rows
        - `columns` string[] — List of columns to allow selecting
        - `limit` integer — Maximum number of rows that can be returned
        - `allow_aggregations` boolean — Allow aggregate queries
      - `comment` string — Comment for the permission
      - `source` string, required — Name of the source database
  - PgDropSelectPermission
    - `type` 'pg_drop_select_permission', required — Type of operation
    - `args` DropPermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `source` string, required — Name of the source database
  - PgCreateUpdatePermission
    - `type` 'pg_create_update_permission', required — Type of operation
    - `args` UpdatePermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `permission` object, required
        - `filter` BoolExp, required — Boolean expression for filtering rows
        - `check` BoolExp, required — Boolean expression for filtering rows
        - `set` ColumnPresets — Column preset values
        - `columns` string[] — List of columns to allow updating
      - `comment` string — Comment for the permission
      - `source` string, required — Name of the source database
  - PgDropUpdatePermission
    - `type` 'pg_drop_update_permission', required — Type of operation
    - `args` DropPermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `source` string, required — Name of the source database
  - PgCreateDeletePermission
    - `type` 'pg_create_delete_permission', required — Type of operation
    - `args` DeletePermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `permission` object, required
        - `filter` BoolExp, required — Boolean expression for filtering rows
      - `comment` string — Comment for the permission
      - `source` string, required — Name of the source database
  - PgDropDeletePermission
    - `type` 'pg_drop_delete_permission', required — Type of operation
    - `args` DropPermissionArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `role` string, required — Role name for the permission
      - `source` string, required — Name of the source database
  - PgCreateObjectRelationship
    - `type` 'pg_create_object_relationship', required — Type of operation to create an object relationship
    - `args` CreateObjectRelationshipArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `name` string, required — Name of the relationship
      - `using` object, required
        - `foreign_key_constraint_on` string, required — Column with the foreign key constraint
      - `comment` string — Comment for the relationship
      - `source` string, required — Name of the source database
  - PgCreateArrayRelationship
    - `type` 'pg_create_array_relationship', required — Type of operation to create an array relationship
    - `args` CreateArrayRelationshipArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `name` string, required — Name of the relationship
      - `using` object, required
        - `foreign_key_constraint_on` object, required
          - `table` TableIdentifier, required
            - `schema` string, required — Schema name
            - `name` string, required — Table name
          - `column` string, required — Column with the foreign key constraint
      - `comment` string — Comment for the relationship
      - `source` string, required — Name of the source database
  - PgDropRelationship
    - `type` 'pg_drop_relationship', required — Type of operation to drop a relationship (both object and array)
    - `args` DropRelationshipArgs, required
      - `table` TableIdentifier, required
        - `schema` string, required — Schema name
        - `name` string, required — Table name
      - `relationship` string, required — Name of the relationship to drop
      - `source` string, required — Name of the source database
  - PgSuggestRelationships
    - `type` 'pg_suggest_relationships', required — Type of operation to suggest relationships based on foreign key constraints
    - `args` PgSuggestRelationshipsArgs, required — Suggest relationships based on foreign key constraints
      - `source` string, required — Name of the source database
      - `schema` string — Schema name to suggest relationships for (defaults to public)
  - ExportMetadata
    - `type` 'export_metadata', required — Type of operation to export the current metadata from the server
  - RemoteSchemaOperation
    - `type` 'add_remote_schema', required — Type of operation to add a remote schema
    - `args` AddRemoteSchemaArgs, required
      - `name` string, required — Name of the remote schema
      - `definition` object, required
        - `url` string, required — URL of the GraphQL server
        - `headers` object[] — Headers to be sent with the request
          - `name` string, required — Name of the header
          - `value` string, required — Value of the header or from env var
          - `value_from_env` string — Environment variable name to get the value from
        - `timeout_seconds` integer — Timeout in seconds
        - `forward_client_headers` boolean — Forward client headers to the remote schema
      - `comment` string — Comment for the remote schema
  - RemoveRemoteSchemaOperation
    - `type` 'remove_remote_schema', required — Type of operation to remove a remote schema
    - `args` RemoveRemoteSchemaArgs, required
      - `name` string, required — Name of the remote schema to remove
  - ReloadRemoteSchemaOperation
    - `type` 'reload_remote_schema', required — Type of operation to reload a remote schema
    - `args` ReloadRemoteSchemaArgs, required
      - `name` string, required — Name of the remote schema to reload

## Response `200`

Operation executed successfully

- object
  - `message` string

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.dev/nhost/apis/hasura-api.md) · [All operations](https://skmtc.dev/nhost/apis/hasura-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nhost/hasura-api/revisions/e0cb77c2f8e2/schema)
