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

# Update Agent Settings

> Updates an agent's working hours and scheduling settings. Changes are applied immediately and the scheduler is re-triggered if the agent is running.

## Endpoint

```
PUT https://api.kakiyo.com/v1/agents/:agentId
```

## Path Parameters

| Parameter | Type   | Required | Description            |
| --------- | ------ | -------- | ---------------------- |
| `agentId` | string | Yes      | The agent ID to update |

## Request Body

All sections are optional. You can update just one section or multiple at once.

### Working Hours

| Field   | Type   | Description                                                           |
| ------- | ------ | --------------------------------------------------------------------- |
| `days`  | string | Working days (Mon-Sun). Format: `1:1:1:1:1:0:0` where 1=active, 0=off |
| `start` | string | Start time in HH:MM format (24-hour)                                  |
| `stop`  | string | End time in HH:MM format (24-hour)                                    |

### Limits

| Field            | Type    | Description                       |
| ---------------- | ------- | --------------------------------- |
| `invitationsMin` | integer | Minimum daily invitations (1-100) |
| `invitationsMax` | integer | Maximum daily invitations (2-100) |
| `messagesMin`    | integer | Minimum daily messages (1-500)    |
| `messagesMax`    | integer | Maximum daily messages (2-500)    |

### Settings

Array of key-value pairs for behavior settings:

| Key               | Type    | Description                                                       |
| ----------------- | ------- | ----------------------------------------------------------------- |
| `skipInNetwork`   | boolean | Don't send messages to prospects already in your LinkedIn network |
| `invitationsOnly` | boolean | Only send invitations, skip follow-up messages                    |

## Response

```json theme={null}
{
  "id": "69724b7100331796aae2",
  "message": "Agent settings updated successfully"
}
```

## Example Requests

### Update Working Hours Only

```bash theme={null}
curl -X PUT "https://api.kakiyo.com/v1/agents/69724b7100331796aae2" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workingHours": {
      "days": "1:1:1:1:1:0:0",
      "start": "08:00",
      "stop": "18:00"
    }
  }'
```

### Update Limits Only

```bash theme={null}
curl -X PUT "https://api.kakiyo.com/v1/agents/69724b7100331796aae2" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "limits": {
      "invitationsMin": 20,
      "invitationsMax": 30,
      "messagesMin": 100,
      "messagesMax": 150
    }
  }'
```

### Update Settings Only

```bash theme={null}
curl -X PUT "https://api.kakiyo.com/v1/agents/69724b7100331796aae2" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": [
      { "key": "skipInNetwork", "value": true }
    ]
  }'
```

### Update Everything

```bash theme={null}
curl -X PUT "https://api.kakiyo.com/v1/agents/69724b7100331796aae2" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workingHours": {
      "days": "1:1:1:1:1:0:0",
      "start": "08:00",
      "stop": "18:00"
    },
    "limits": {
      "invitationsMin": 20,
      "invitationsMax": 30,
      "messagesMin": 100,
      "messagesMax": 150
    },
    "settings": [
      { "key": "skipInNetwork", "value": true }
    ]
  }'
```

## Working Days Format

The `days` parameter uses a colon-separated format representing Monday through Sunday:

| Position | Day       |
| -------- | --------- |
| 1st      | Monday    |
| 2nd      | Tuesday   |
| 3rd      | Wednesday |
| 4th      | Thursday  |
| 5th      | Friday    |
| 6th      | Saturday  |
| 7th      | Sunday    |

**Examples:**

* `1:1:1:1:1:0:0` - Monday to Friday
* `1:1:1:1:1:1:0` - Monday to Saturday
* `0:1:1:1:1:1:0` - Tuesday to Saturday

Changes are applied immediately. If the agent is running, the scheduler is automatically re-triggered with the new settings.


## OpenAPI

````yaml PUT /agents/{id}
openapi: 3.1.0
info:
  title: Kakiyo API
  description: API for automating LinkedIn outreach campaigns with AI-powered conversations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.kakiyo.com/v1
security:
  - bearerAuth: []
paths:
  /agents/{id}:
    put:
      summary: Update Agent Settings
      description: >-
        Updates an agent's working hours and scheduling settings. Changes are
        applied immediately and the scheduler is re-triggered if the agent is
        running.
      operationId: updateAgentSettings
      parameters:
        - name: id
          in: path
          description: ID of the agent
          required: true
          schema:
            type: string
      requestBody:
        description: Agent settings to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentSettingsRequest'
        required: true
      responses:
        '200':
          description: Agent settings updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: agent_12345abcde
                  message:
                    type: string
                    example: Agent settings updated successfully
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden - agent belongs to another team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateAgentSettingsRequest:
      type: object
      minProperties: 1
      example:
        workingHours:
          days: '1:1:1:1:1:0:0'
          start: '08:00'
          stop: '18:00'
        limits:
          invitationsMin: 20
          invitationsMax: 30
          messagesMin: 100
          messagesMax: 150
        settings:
          - key: skipInNetwork
            value: true
      properties:
        workingHours:
          type: object
          description: Configure when the agent should be active
          properties:
            days:
              type: string
              pattern: ^[01]:[01]:[01]:[01]:[01]:[01]:[01]$
              description: >-
                Working days (Mon-Sun). Format: 7 values separated by colons,
                1=working, 0=off. Must include at least one working day.
              example: '1:1:1:1:1:0:0'
            start:
              type: string
              pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
              description: Start time in HH:MM format (24-hour)
              example: '08:00'
            stop:
              type: string
              pattern: ^([01]?[0-9]|2[0-3]):[0-5][0-9]$
              description: End time in HH:MM format (24-hour)
              example: '18:00'
        limits:
          type: object
          description: Daily activity limits for the agent
          properties:
            invitationsMin:
              type: integer
              minimum: 1
              maximum: 100
              description: Minimum daily invitations
              example: 20
            invitationsMax:
              type: integer
              minimum: 2
              maximum: 100
              description: Maximum daily invitations
              example: 30
            messagesMin:
              type: integer
              minimum: 1
              maximum: 500
              description: Minimum daily messages
              example: 100
            messagesMax:
              type: integer
              minimum: 2
              maximum: 500
              description: Maximum daily messages
              example: 150
        settings:
          type: array
          description: Agent behavior settings
          items:
            type: object
            required:
              - key
              - value
            properties:
              key:
                type: string
                enum:
                  - skipInNetwork
                  - invitationsOnly
                description: Setting key
              value:
                type: boolean
                description: Setting value
          example:
            - key: skipInNetwork
              value: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        message:
          type: string
          example: The request parameters failed validation
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: The name field is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````