> ## Documentation Index
> Fetch the complete documentation index at: https://developers.datagrid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Claim a generated agent template

> Redeem a `claim_token` from a prior `POST /agents/generate` call to retrieve the generated agent template. The token is consumed (single-use). Use the returned template to pre-populate the agent creation dialog.



## OpenAPI

````yaml post /agents/claim
openapi: 3.0.3
info:
  version: 0.1.1
  title: Datagrid API
  description: Datagrid API
servers:
  - url: https://api.datagrid.com/v1
security:
  - BearerAuth: []
paths:
  /agents/claim:
    post:
      tags:
        - Agents
      summary: Claim a generated agent template
      description: >-
        Redeem a `claim_token` from a prior `POST /agents/generate` call to
        retrieve the generated agent template. The token is consumed
        (single-use). Use the returned template to pre-populate the agent
        creation dialog.
      operationId: ClaimAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - claim_token
              properties:
                claim_token:
                  type: string
                  format: uuid
                  description: The claim token returned from `POST /agents/generate`
      responses:
        '200':
          description: Agent template retrieved successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - title
                  - description
                  - emoji
                  - category
                  - connectors
                  - prompt_examples
                properties:
                  id:
                    type: string
                  title:
                    type: string
                  description:
                    type: string
                  emoji:
                    type: string
                  category:
                    type: string
                  is_curated_template:
                    type: boolean
                    nullable: true
                  connectors:
                    type: array
                    items:
                      type: object
                  prompt_examples:
                    type: array
                    items:
                      type: string
                  config:
                    type: object
                    nullable: true
                    properties:
                      prompt:
                        type: string
                        nullable: true
                      custom_prompt:
                        type: string
                        nullable: true
                      tools:
                        type: array
                        items:
                          type: object
                          properties:
                            tool:
                              type: string
        '404':
          description: Claim token is invalid or expired
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Datagrid from 'datagrid-ai';


            const client = new Datagrid({
              apiKey: process.env['DATAGRID_API_KEY'], // This is the default and can be omitted
            });


            const response = await client.agents.claim({ claim_token:
            '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });


            console.log(response.id);
        - lang: Python
          source: |-
            import os
            from datagrid_ai import Datagrid

            client = Datagrid(
                api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
            )
            response = client.agents.claim(
                claim_token="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.id)
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````