---
title: "Replace Todo"
url: "https://kiwi.arashsheyda.me/apis/stoplight-3/versions/8b88146a-3da5-4ca7-8179-7ad4727ac5a1/operations/put-todos-id"
---

> Full API specification: https://kiwi.arashsheyda.me/apis/stoplight-3/versions/8b88146a-3da5-4ca7-8179-7ad4727ac5a1.md

# Replace Todo

`PUT` `/todos/{id}`

Operation ID: `put-todos-id`

Update a single todo using an ID *Markdown is supported in descriptions. Add information here for users to get accustomed to endpoints*

## Path parameters

- `id` (string, required) - ID of the Todo

## Request body

Content types: `application/json`

## Responses

- `200` - Todo Updated
- `403` - Action not allowed
- `404` - Resource not found

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: To-dos
  version: 1.0.0
servers:
  - url: https://todos.stoplight.io
    description: Production
  - description: Sandbox
    url: https://todos-sandbox.stoplight.io
paths:
  /todos/{id}:
    parameters:
      - $ref: "#/components/parameters/ID"
    put:
      summary: Replace Todo
      operationId: put-todos-id
      responses:
        "200":
          description: Todo Updated
        "403":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Todos"
        description: ""
      description: >-
        Update a single todo using an ID


        *Markdown is supported in descriptions. Add information here for users
        to get accustomed to endpoints*
      security:
        - API Key: []
security:
  - API Key: []
components:
  parameters:
    ID:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: ID of the Todo
  responses:
    Unauthorized:
      description: Action not allowed
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            required:
              - message
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            title: Error
            type: object
            description: A standard error object.
            x-tags:
              - Common
            properties:
              status:
                type: string
                description: A code.
              error:
                type: string
            required:
              - status
              - error
  schemas:
    Todos:
      description: I'm a model's description.
      type: object
      title: Todo
      properties:
        id:
          type: number
          minimum: 0
          maximum: 9999
          description: ID of the task
          readOnly: true
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Name of the task
        completed:
          type: boolean
          default: false
          description: Boolean indicating if the task has been completed or not
        completed_at:
          type: string
          format: date-time
          description: Time when the task was completed
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: Time when the task was created
          readOnly: true
        updated_at:
          type: string
          format: date-time
          description: Time when the task was updated
          readOnly: true
      required:
        - id
        - name
        - completed_at
        - created_at
        - updated_at
  securitySchemes:
    API Key:
      name: apikey
      type: apiKey
      in: query
      description: Just use `123`. It's super secure ;)
```
