> ## Documentation Index
> Fetch the complete documentation index at: https://cortex-e852fafe-t3code-rewrite-docs-declutter.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Discover Resources

> List the resources a connector's credentials can reach, before choosing which to sync.

Asks the provider which resources the connector's stored credentials can reach: channels, repositories, databases, tables, folders and so on. Call it before [Configure Connector](/api-reference/v2/endpoint/configure-connector) to decide what to sync.

Pass an entry's `id` as `resource_id`, together with its `resource_type` and `name`, to Configure.

Providers that sync a whole account rather than individual resources return a single entry with `id` `all` and `resource_type` `workspace`. Configure that one entry to sync everything.

For providers with many resources, page through the list with `limit` (1 to 100) and `cursor`, and keep going while `has_more` is `true`.

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://api.hydradb.com/connectors/{id}/discover' \
    -H "Authorization: Bearer $HYDRA_DB_API_KEY" \
    -H "API-Version: 2"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "provider": "slack",
    "resources": [
      {
        "id": "C0123456789",
        "name": "general",
        "resource_type": "channel"
      },
      {
        "id": "C0987654321",
        "name": "engineering",
        "resource_type": "channel"
      }
    ]
  }
  ```
</ResponseExample>

## Errors

* `404`: no connector with this id in your workspace.
* `422`: the stored credentials are no longer valid. Replace them with [Update Connector](/api-reference/v2/endpoint/update-connector).
* `400` or `502`: the provider rejected the request or could not be reached. The message carries the provider's explanation.

<div className="api-before-related-resources" />

## Related Resources

* **Next:** [Configure Connector](/api-reference/v2/endpoint/configure-connector): choose resources and start syncing
* [List Connector Resources](/api-reference/v2/endpoint/connector-resources): resources already configured


## OpenAPI

````yaml api-reference/v2/openapi.json GET /connectors/{id}/discover
openapi: 3.1.0
info:
  contact:
    email: support@hydradb.com
    name: HydraDB Support
  description: >-
    HydraDB Application API — knowledge ingestion, search, and memory
    management.
  license:
    name: Proprietary
  title: HydraDB Application API
  version: 0.1.0
servers:
  - description: Production server
    url: https://api.hydradb.com
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /connectors/{id}/discover:
    get:
      tags:
        - connectors
      summary: Discover connector resources
      description: >-
        List a connected provider's resources using the connector's stored
        credentials. `cursor` or `limit` paginates (currently Notion only);
        continue while `has_more` is `true`.
      parameters:
        - description: Connector ID
          in: path
          name: id
          required: true
          schema:
            example: HydraDoc1234
            type: string
        - description: Opaque pagination cursor from a previous response's next_cursor
          in: query
          name: cursor
          schema:
            type: string
        - description: Max resources per page, 1-100 (values above 100 are clamped)
          in: query
          name: limit
          schema:
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.discoverResponseBody'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: Bad Gateway
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: Service Unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    handler.discoverResponseBody:
      properties:
        has_more:
          description: >-
            Present and `true` when more pages remain. Only on paginated
            requests (`limit` or `cursor`); fetch the next page with
            `next_cursor`.
          example: true
          type: boolean
        next_cursor:
          description: >-
            Opaque pagination cursor for the next page; null or absent when no
            more pages.
          example: eyJvZmZzZXQiOjUwfQ==
          type: string
        provider:
          description: >-
            External provider being synced (e.g. `slack`, `github`, `linear`,
            `notion`, `gmail`).
          example: slack
          type: string
        resources:
          description: >-
            Resources available to the connector's credentials. Pass an entry's
            `id` (as `resource_id`) and `resource_type` to Configure.
          example:
            - id: HydraDoc1234
              metadata:
                department: finance
                priority: 7
              name: general
              resource_type: channel
          items:
            $ref: '#/components/schemas/handler.discoveredResourceDTO'
          type: array
          uniqueItems: false
      type: object
    handler.ErrorResponse:
      properties:
        data:
          description: Always `null` on this error response.
        detail:
          $ref: '#/components/schemas/handler.ErrorDetail'
          description: Structured error detail with code, message, and deprecation hints.
          example:
            deprecated: true
            deprecated_field: tenant_id
            error_code: VALIDATION_ERROR
            message: Request validation failed
            preferred_field: database
        error:
          $ref: '#/components/schemas/handler.apiError'
          description: Error message, empty string on success.
          example:
            code: DATABASE_NOT_FOUND
            message: Database not found
        meta:
          $ref: '#/components/schemas/handler.ErrorMeta'
          example:
            latency_ms: 12.3
            request_id: 9d13aef4-02f4-4e73-8c62-4c2601d04f9d
        success:
          description: Whether the request succeeded.
          example: false
          type: boolean
      type: object
    handler.discoveredResourceDTO:
      properties:
        id:
          description: Unique identifier for this resource.
          example: HydraDoc1234
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Provider-specific details about this resource, for display. Shape
            varies by provider.
          example:
            department: finance
            priority: 7
          type: object
        name:
          description: Human-readable label for this resource.
          example: general
          type: string
        resource_type:
          description: >-
            Type of resource within the provider (e.g. `channel`, `repo`,
            `linear_team`).
          example: channel
          type: string
      type: object
    handler.ErrorDetail:
      properties:
        deprecated:
          description: Whether this response concerns a deprecated field or route.
          example: true
          type: boolean
        deprecated_field:
          description: The deprecated field name.
          example: tenant_id
          type: string
        error_code:
          description: Machine-readable error classification code.
          example: VALIDATION_ERROR
          type: string
        message:
          description: Human-readable description of the error.
          example: Request validation failed
          type: string
        preferred_field:
          description: The canonical replacement for the deprecated field.
          example: database
          type: string
        success:
          deprecated: true
          description: >-
            Deprecated: always `false`. Read the HTTP status, then `error.code`
            and `error.message`.
          example: false
          type: boolean
          x-deprecated: 'true'
      type: object
    handler.apiError:
      properties:
        code:
          description: Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).
          example: DATABASE_NOT_FOUND
          type: string
        message:
          description: Human-readable description of the error.
          example: Database not found
          type: string
      type: object
    handler.ErrorMeta:
      properties:
        api_version:
          description: Version of the API that served the request, for example `2.0.1`.
          type: string
        latency_ms:
          description: Server-side processing time in milliseconds.
          example: 12.3
          type: number
        request_id:
          description: Unique identifier for this request, useful for support and tracing.
          example: 9d13aef4-02f4-4e73-8c62-4c2601d04f9d
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API key
      description: 'API key sent as a Bearer token: "Bearer prefix.secret"'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.