---
title: "Create a new task for service"
method: POST
path: "/project/{project}/service/{service_name}/task"
tags: ["Service"]
---

# Create a new task for service

`POST /project/{project}/service/{service_name}/task`

## Path parameters

- `project` string, required
- `service_name` string, required

## Request body

- ServiceTaskCreateRequestBody — ServiceTaskCreateRequestBody
  - `create_searchable_snapshot` object — Move indices to a searchable snaphshot
    - `indices` string, required — The indices to move to a searchable snapshot. Use , to create a list of indexes, * to specify an index pattern, and - to exclude certain indexes.
  - `create_user_backup` object — Payload to be used with create_user_backup
    - `backup_name` string, required — The output file name.
  - `dataset_import` object — Payload to be used with dataset_import
    - `dataset_name` 'pagila', required — Name of the dataset to import to PostgreSQL database. Used with dataset_import.
  - `migration_check` object — Payload to be used with migration_check
    - `ignore_dbs` string — Comma-separated list of databases, which should be ignored during migration (supported by MySQL and PostgreSQL only at the moment)
    - `ignore_roles` string — Comma-separated list of database roles, which should be ignored during migration (supported by PostgreSQL only at the moment)
    - `method` 'dump' | 'replication' — The migration method to be used (currently supported only by Redis, Dragonfly, MySQL and PostgreSQL service types)
    - `source_project_name` string — Project name
    - `source_service_name` string — Service name
    - `source_service_uri` string — Service URI of the source MySQL or PostgreSQL database with admin credentials. Used with migration_check.
  - `target_version` string — Deprecated! Use 'upgrade_check' field
  - `task_type` 'upgrade_check' | 'migration_check' | 'dataset_import' | 'create_user_backup' | 'create_searchable_snapshot', required — Service task type
  - `upgrade_check` object — Payload to be used with upgrade_check
    - `async` boolean — Run task asynchronously and return immediately
    - `target_version` string, required — Target version used with upgrade_check

## Response `200`

Response

- ServiceTaskCreateResponse — ServiceTaskCreateResponse
  - `errors` object[] — List of errors occurred during request processing
    - `message` string, required — Printable error message
    - `more_info` string — URL to the documentation of the error
    - `status` integer, required — HTTP error status code
  - `message` string — Printable result of the request
  - `task` object, required — Task info
    - `create_time` string, required — Timestamp in ISO 8601 format, always in UTC
    - `result` string, required — Task result
    - `result_codes` object[] — List of result codes
      - `code` string, required — Machine-readable key code, which represents the result of the task
      - `dbname` string — Database which related to the result code
    - `success` boolean, required — Task success
    - `task_id` string, required — Unique identifier for the task
    - `task_type` string, required — Task type

---

[API](https://skmtc.net/aiven/apis/aiven-api-documentation.md) · [All operations](https://skmtc.net/aiven/apis/aiven-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aiven/aiven-api-documentation/versions/ecaeabf1da31/schema)
