---
title: operations
sidebarTitle: operations
---

# `pdsx._internal.operations`


atproto record operations.

## Functions

### `list_records` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/operations.py#L22" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
list_records(client: AsyncClient, collection: str, limit: int, repo: str | None = None, cursor: str | None = None) -> models.ComAtprotoRepoListRecords.Response
```


list records in a collection.

**Args:**
- `client`: authenticated atproto client
- `collection`: collection name
- `limit`: maximum number of records
- `repo`: optional repo DID (defaults to authenticated user)
- `cursor`: optional pagination cursor

**Returns:**
- response with records and optional cursor for next page


### `get_record` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/operations.py#L57" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
get_record(client: AsyncClient, uri: str, repo: str | None = None) -> models.ComAtprotoRepoGetRecord.Response
```


get a specific record.

**Args:**
- `client`: authenticated atproto client
- `uri`: record AT-URI (can be shorthand like 'collection/rkey' if authenticated or repo provided)
- `repo`: repository DID/handle (enables shorthand URIs with -r flag)

**Returns:**
- record response


### `create_record` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/operations.py#L100" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
create_record(client: AsyncClient, collection: str, record: dict[str, RecordValue]) -> models.ComAtprotoRepoCreateRecord.Response
```


create a new record.

**Args:**
- `client`: authenticated atproto client
- `collection`: collection name
- `record`: record data

**Returns:**
- created record response


### `update_record` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/operations.py#L135" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
update_record(client: AsyncClient, uri: str, updates: dict[str, RecordValue]) -> models.ComAtprotoRepoPutRecord.Response
```


update an existing record.

**Args:**
- `client`: authenticated atproto client
- `uri`: record AT-URI (can be shorthand like 'collection/rkey' if authenticated)
- `updates`: fields to update

**Returns:**
- updated record response


### `delete_record` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/operations.py#L179" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
delete_record(client: AsyncClient, uri: str) -> None
```


delete a record.

**Args:**
- `client`: authenticated atproto client
- `uri`: record AT-URI (can be shorthand like 'collection/rkey' if authenticated)


### `upload_blob` <sup><a href="https://github.com/zzstoatzz/pdsx/blob/main/src/pdsx/_internal/operations.py#L200" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
upload_blob(client: AsyncClient, file_path: str | Path) -> models.ComAtprotoRepoUploadBlob.Response
```


upload a blob (image, video, etc.).

**Args:**
- `client`: authenticated atproto client
- `file_path`: path to file to upload

**Returns:**
- upload response with blob reference

