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

# Create Agent Auth Profile

> Securely stores authentication data for an agent. This endpoint encrypts sensitive credentials that the agent needs to access external services. The data is stored securely and can only be accessed using the returned auth token when running the agent.

## Overview

This endpoint allows you to create a secure authentication profile for your agent. Think of it as setting up a secure vault of credentials that your agent can access when it needs to interact with external services. Instead of hardcoding API keys or passwords in your agent configuration, you can use this endpoint to store them securely.

## How it works

1. You provide an authentication profile name, agent ID, API key, and a dictionary of authentication data (key-value pairs)
2. The system validates that the keys in your auth data match the input arguments defined for your agent
3. The system creates an encrypted authentication profile and stores it securely
4. You receive an auth token that you can use when running your agent to access this profile

## Security features

* Your authentication profile is encrypted before storage
* The encryption key is never stored - only you receive the auth token
* Each auth token is bound to a specific agent\_id and cannot be used with different agents

## Using the auth token

When you run your agent using the `/run_agent` endpoint, you can include the auth token to give your agent access to its authentication profile. The system will automatically decrypt and provide the authentication data to your agent during execution.

## Important notes

* The keys in your auth\_data must be input arguments defined for your agent
* Store the returned auth\_token securely - it cannot be recovered if lost
* Create different authentication profiles as needed for different credential sets or accounts
* Auth tokens can only be used with the specific agent\_id they were generated for


## OpenAPI

````yaml POST /api/create_agent_auth_profile
openapi: 3.0.1
info:
  title: Kura API
  description: API specification for Kura's agent and session management endpoints
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://backend.trykura.com
security: []
paths:
  /api/create_agent_auth_profile:
    post:
      description: >-
        Securely stores authentication data for an agent. This endpoint encrypts
        sensitive credentials that the agent needs to access external services.
        The data is stored securely and can only be accessed using the returned
        auth token when running the agent.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentAuthProfileRequest'
      responses:
        '200':
          description: Authentication data stored successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAgentAuthProfileResponse'
        '400':
          description: Bad request - auth data doesn't match agent arguments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateAgentAuthProfileRequest:
      type: object
      required:
        - name
        - agent_id
        - api_key
        - auth_data
      properties:
        name:
          type: string
          description: >-
            Name of the auth data entry, usually the name of the account or
            service
        agent_id:
          type: string
          description: Unique identifier for the agent
        api_key:
          type: string
          description: API key for authentication
        auth_data:
          type: object
          description: >-
            Key-value pairs of sensitive authentication data that will be
            encrypted. Keys must match the agent's defined input arguments.
          additionalProperties:
            type: string
    CreateAgentAuthProfileResponse:
      type: object
      required:
        - auth_token
      properties:
        auth_token:
          type: string
          description: >-
            Secure token provided when running the agent to access stored
            authentication data
          example: YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTY3ODkwYWJjZGVmZ2g=
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````