---
title: "Start a resync and get back where to poll for it"
method: POST
path: "/api/jobs"
tags: ["Jobs"]
---

# Start a resync and get back where to poll for it

`POST /api/jobs`

## Request

- Base URL: `https://youspot.com`
- URL: `https://youspot.com/api/jobs`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://youspot.com/oauth/authorize`, token URL `https://youspot.com/oauth/token`, scopes: `linkedin`)

Work that cannot finish inside one request answers `202 Accepted` rather than making you wait. `Location` names the job, and `poll` in the body is the same URL for clients that read bodies rather than headers.

Starting the same kind twice while it is still running reports the running job instead of queuing a second one, and still answers 202: the work is accepted either way. `started` says which call was the one that queued it.

Every kind here re-reads accounts you have already connected, so it is safe to repeat. Nothing destructive can be started this way.

## Headers

- `Idempotency-Key` string

## Request body

- JobRequest
  - `kind` 'linkedin_posts_sync' | 'twitter_posts_sync' | 'twitter_connections_sync' | 'embed_objects', required: Which resync to run. Anything else is a 400 that names the ones you can.

## Response `202`

The job is queued or already running.

- JobAccepted
  - `success` boolean, required
  - `job_id` integer, required
  - `kind` 'linkedin_posts_sync' | 'twitter_posts_sync' | 'twitter_connections_sync' | 'embed_objects', required
  - `state` 'queued' | 'running', required
  - `started` boolean, required: False when this kind was already running and that job is the one named here.
  - `poll` string, uri, required: Where to poll. The same URL as the `Location` header.

## Other responses

- `400`: The request was refused. `error` is stable; read `error_description` for the reason.
- `401`: The request was refused. `error` is stable; read `error_description` for the reason.
- `422`: This `Idempotency-Key` was already used on this operation with a different request body.

---

[API](https://skmtc.dev/youspot/apis/youspot-http-api.md) · [All operations](https://skmtc.dev/youspot/apis/youspot-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/youspot/apis/youspot-http-api/revisions/6615ad5d017d?raw)
