---
title: "Create a robot account"
method: POST
path: "/robots"
tags: ["robot"]
---

# Create a robot account

`POST /robots`

Create a robot account

## Headers

- `X-Request-Id` string

## Request body

- RobotCreate — The request for robot account creation.
  - `name` string — The name of the robot
  - `description` string — The description of the robot
  - `secret` string — The secret of the robot
  - `level` string — The level of the robot, project or system
  - `disable` boolean — The disable status of the robot
  - `duration` integer — The duration of the robot in days, duration must be either -1(Never) or a positive integer
  - `permissions` RobotPermission[]
    - `kind` string — The kind of the permission
    - `namespace` string — The namespace of the permission
    - `access` Access[]
      - `resource` string — The resource of the access. Possible resources are listed here for system and project level https://github.com/goharbor/harbor/blob/main/src/common/rbac/const.go
      - `action` string — The action of the access. Possible actions are *, pull, push, create, read, update, delete, list, operate, scanner-pull and stop.
      - `effect` string — The effect of the access

## Response `201`

Created

- RobotCreated — The response for robot account creation.
  - `id` integer — The ID of the robot
  - `name` string — The name of the robot
  - `secret` string — The secret of the robot
  - `creation_time` string, date-time — The creation time of the robot.
  - `expires_at` integer — The expiration date of the robot

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.dev/goharbor/apis/harbor-api.md) · [All operations](https://skmtc.dev/goharbor/apis/harbor-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goharbor/harbor-api/revisions/62d78801f8df/schema)
