# Adding jobs

The most basic operation in BullMQ is adding a job. A job is simply a data structure that has a name, some custom data and options. Jobs are added posting a JSON object to the `/queues/:queue-name` endpoint. The endpoint accepts an array of jobs, if sending a standalone job do not forget to wrap it in an array.

{% hint style="info" %}
Posting jobs is an atomic operation, either all jobs or none will be added to the queue, so if the call fails for any reason, you can be certain that no jobs were added at all.
{% endhint %}

The JSON object must follow this interface:

```typescript
interface Job {
  name: string;
  data: any;
  opts?: JobOpts;
}
```

Lets add the simplest possible job:

{% tabs %}
{% tab title="Curl" %}

```powershell
curl --location 'https://myproxy.dev/queues/my-queue/jobs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer my-secret-token' \
--data '[{
	"name": "paint-red",
        "data": {},
        }]'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Note how we wrap the job in an array, as we are only sending one job in this example.
{% endhint %}

The call should succeed and return the complete Job as a Json object with all the defaults as it is stored in BullMQ:

```json
[
  {
    "name": "paint-red",
    "data": {},
    "opts": { "attempts": 0, "delay": 0 },
    "id": "116",
    "progress": 0,
    "returnvalue": null,
    "stacktrace": null,
    "attemptsStarted": 0,
    "attemptsMade": 0,
    "delay": 0,
    "timestamp": 1708597320043,
    "queueQualifiedName": "bull:my-test-queue"
  }
]
```

There are obviously many more advanced jobs and features which we will cover in the next pages.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bullmq.net/http-api/queues/adding-jobs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
