---
updatedAt: 2026-06-17T13:38:37.000Z
agentTools:
  projectIndex: https://documentation.picsellia.com/llms.txt
---

# Annotationcampaign

#

# *Properties*

* `dataset_version_id` UUID of the [DatasetVersion](datasetversion) of this campaign

* `name` Deprecated property

***

# *Methods*

## close

```python
close()
```

**Description**

Close a campaign.

:warning: **DANGER ZONE**: Be very careful here!

It will close this campaign. The campaign will be locked and changes won't be allowed anymore.

A closed dataset campaign CANNOT be reopened.
If you need to reopen it, we suggest you fork the dataset version first and create a new campaign.

A closed deployment campaign can be reopened.

**Examples**

```python
foo_campaign.close()
```

***

## delete

```python
delete()
```

**Description**

Delete a campaign.

:warning: **DANGER ZONE**: Be very careful here!

It will remove this campaign from our database, all tasks and assignments will be removed.
This will not delete annotations, reviews and assets.

**Examples**

```python
foo_campaign.delete()
```

***

## add\_step

```python
add_step(
   name: str, type: (CampaignStepType|str), description: (str|None) = None,
   assignees: (list[tuple[User|UUID|Worker, float|int]]|None) = None,
   order: (int|None) = None, sample_rate: (float|None) = None
)
```

**Description**

Add a step on this campaign.

`assignees` changed signature in 6.24, we now except a User or a user UUID.
Worker will still be accepted until 6.26

**Examples**

```python
users = foo_dataset.list_users()
# In first step, 2 over 3 annotation task will be assigned to user 1, third one is going to user 0
foo_campaign.add_step(
    name="annotation-step",
    type="ANNOTATION",
    description="annotation step",
    assignees=[(users[0], 1.0), (users[1], 2.0)]
)
# In second step, all review task will be assigned to user 2
foo_campaign.add_step(
    name="review-step",
    type="REVIEW",
    description="review step",
    assignees=[(users[2], 1)]
)
```

**Arguments**

* *name* (str) : name of the step

* *type* (str or CampaignStepType) : Type of the step: can be ANNOTATION or REVIEW

* *description* (str, optional) : Description of the step. Defaults to None.

* *assignees* (list of tuple of (user or UUID), float, optional) : Can be used to assign users to this step.
  Defaults to None.

* *order* (int, optional) : Index where to insert the step in the workflow, the step will be appended at the end
  if nothing is specified. Defaults to None.

* *sample\_rate* (float, optional) : sample rate of this step. Defaults to None.

**Returns**

dict, data of this step

***

## list\_steps

```python
list_steps()
```

**Description**

List all the steps of this campaign.

**Returns**

a list of steps of this campaign as python dict

***

## list\_assignments

```python
list_assignments(
   step_id: (UUID|str|None) = None, status: (AssignmentStatus|str|None) = None,
   user: (User|Literal['unassigned']|None) = None,
   custom_metadata: (dict|None) = None, query: (str|None) = None
)
```

**Description**

List current (Assignment) of this campaign.

**Returns**

a list of (Assignment) of this campaign

***

## reassign

```python
reassign(
   assignments: list[TCampaignAssignment], user: (User|None) = None
)
```

**Description**

***

## get\_campaign\_issue\_counts

```python
get_campaign_issue_counts(
   users: (list[User|UUID|str]|None) = None,
   steps: (list[TCampaignStep|UUID|str]|None) = None
)
```

**Description**

Get campaign issue counts for a list of users

**Returns**

* *user\_id* (UUID | None) : id of the user, None if unassigned
  opened (int): count of opened issue
  closed (int): count of closed issue

a list of a dict with keys

***

## update

```python
update(
   name: (str|None) = None, description: (str|None) = None,
   instructions_object_name: (str|None) = None, instructions_text: (str|None) = None,
   end_date: (date|None) = None, auto_add_new_assets: (bool|None) = None,
   auto_close_on_completion: (bool|None) = None,
   default_entry_step: (AnnotationCampaignStep|None) = None,
   annotated_entry_step: (AnnotationCampaignStep|Literal['DONE']|None) = None
)
```

**Description**

Update this campaign parameters

**Examples**

```python
foo_campaign.update(description="Yet another campaign")
```

**Arguments**

* *name* (str, optional) : deprecated.

* *description* (str, optional) : Description of the campaign. Defaults to None.

* *instructions\_object\_name* (str, optional) : Instructions file object name stored on S3. Defaults to None.

* *instructions\_text* (str, optional) : Instructions text. Defaults to None.

* *end\_date* (date, optional) : End date of the campaign. Defaults to None.

* *default\_entry\_step* (Step, optional) : Step where tasks will be created for items that have no annotations.

* *annotated\_entry\_step* (Step, optional) : Step where tasks will be created for items already containing annotations

auto\_add\_new\_assets (bool, optional):
If true, new assets of this dataset will be added as a task in the campaign.  Defaults to None.
auto\_close\_on\_completion (bool, optional):
If true, campaign will be close when all tasks will be done. Defaults to None.

***

## upload\_instructions\_file

```python
upload_instructions_file(
   path: str
)
```

**Description**

Upload instructions for this campaign

**Examples**

```python
foo_campaign.upload_instructions_file("/path/to/file.pdf")
```

**Arguments**

* *path* (str) : Path of instructions file

***

## launch

```python
launch(
   existing_annotations_step_id: (str|UUID|None) = None
)
```

**Description**

This method is deprecated. self.sync\_assets() should be used instead
Launch this campaign, creating assignments on steps you have created before.

**Examples**

```python
workers = foo_dataset.list_workers()
foo_campaign = foo_dataset_version.create_campaign()
foo_campaign.add_step(
    name="annotation-step",
    type="ANNOTATION",
    assignees=[(workers[0], 1.0), (workers[1], 2.0)]
)
review_step = foo_campaign.add_step(
    name="review-step",
    type="REVIEW",
    assignees=[(workers[2], 1)]
)
foo_campaign.launch(existing_annotations_step_id=review_step["id"])
```

**Arguments**

existing\_annotations\_step\_id (UUID or str, optional):
If given, will create assignments for existing annotations on given step\_id.
You also can give "DONE" in this field, it will create assignments in DONE last step. Defaults to None.

**Returns**

a Job, that you can wait for.

***

## sync\_assets

```python
sync_assets(
   existing_annotations_step_id: (str|UUID|None) = None
)
```

**Description**

This will create tasks and assignments for assets that are not in the campaign yet.

By default, your already annotated assets will be synced to the annotated\_entry\_step in your campaign settings.
Using existing\_annotations\_step\_id here will override this setting once.

**Arguments**

existing\_annotations\_step\_id (UUID or str, optional):
If given, will create assignments for existing annotations on given step\_id.
You also can give "DONE" in this field, it will create assignments in DONE last step. Defaults to None.

**Returns**

a Job, that you can wait for.

***