---
title: "POST /tasks"
method: POST
path: "/tasks"
tags: ["tasks"]
---

# POST /tasks

`POST /tasks`

## Request

- Base URL: `https://api.mrscraper.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mrscraper.com/tasks`
- Auth: one of:
  - API key in header `x-api-token`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/mrscraper/apis/scraper-service-gateway-api/docs/tasks/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- TaskTaskSwagger
  - `action` string
  - `browserType` 'CHROME' | 'FIREFOX' | 'SAFARI'
  - `callbackUrl` string
  - `createdAt` string
  - `deviceOs` 'WINDOWS' | 'MACOS' | 'LINUX'
  - `domain` string
  - `fingerprintId` integer
  - `id` integer
  - `jobId` integer
  - `proxy` string
  - `result` string
  - `retryCount` integer
  - `scrapeTime` number
  - `solution` string
  - `status` 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED'
  - `statusMessage` string
  - `taskDetails` object
  - `tokenUsage` integer
  - `updatedAt` string
  - `userId` string

## Response `201`

Task created

- object
  - `data` TaskTask
    - `action` string
    - `browserType` 'CHROME' | 'FIREFOX' | 'SAFARI'
    - `callbackUrl` string
    - `createdAt` string
    - `deviceOs` 'WINDOWS' | 'MACOS' | 'LINUX'
    - `domain` string
    - `fingerprintId` integer
    - `id` integer
    - `jobId` integer
    - `proxy` string
    - `result` string
    - `retryCount` integer
    - `scrapeTime` number
    - `solution` string
    - `status` 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED'
    - `statusMessage` string
    - `taskDetails` object
    - `updatedAt` string
    - `userId` string
  - `message` string

## Other responses

- `202`: Task queued for a database retry; taskId is omitted when no ID has been reserved

---

[API](https://skmtc.dev/mrscraper/apis/scraper-service-gateway-api.md) - [All operations](https://skmtc.dev/mrscraper/apis/scraper-service-gateway-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mrscraper/apis/scraper-service-gateway-api/revisions/8bc866001a0b?raw)
