~sircmpwn/sr.ht-docs

4109e8c49cb256e3e3a1f691342b18612ecb16eb — Drew DeVault 2 years ago 22705b0
Standardize layout/language of oauth scopes
2 files changed, 41 insertions(+), 39 deletions(-)

M meta.sr.ht/user-api.md
M paste.sr.ht/api.md
M meta.sr.ht/user-api.md => meta.sr.ht/user-api.md +34 -34
@@ 81,16 81,16 @@ resource](../api-conventions.md#user-resource).

### GET /api/user/profile

**OAuth scope**: `profile:read`

Returns the authenticated user's [user resource](#user-resource).

### PUT /api/user/profile
**OAuth scope**: `profile:read`

**OAuth scope**: `profile:update`
### PUT /api/user/profile

Updates the authenticated user's profile.

**OAuth scope**: `profile:update`

**Request body**

```json


@@ 114,22 114,22 @@ Updated [user resource](#user-resource).

### GET /api/user/audit-log

**OAuth scope**: `audit-log:read`

List of [audit log entry resources](#audit-log-entry-resource).

### GET /api/user/ssh-keys
**OAuth scope**: `audit-log:read`

**OAuth scope**: `keys:read`
### GET /api/user/ssh-keys

List of [SSH key resources](#ssh-key-resource).

### POST /api/user/ssh-keys
**OAuth scope**: `keys:read`

**OAuth scope**: `keys:write`
### POST /api/user/ssh-keys

Creates a new [SSH key resource](#ssh-key-resource).

**OAuth scope**: `keys:write`

**Request body**

```json


@@ 144,38 144,38 @@ The new [SSH key resource](#ssh-key-resource).

### GET /api/user/ssh-keys/:id

**OAuth scope**: `keys:read`

Retrieves an [SSH key resource](#ssh-key-resource). 

### PUT /api/user/ssh-keys/:id
**OAuth scope**: `keys:read`

**OAuth scope**: `keys:write`
### PUT /api/user/ssh-keys/:id

Updates the "last_used" time of this SSH key resource.

**OAuth scope**: `keys:write`

**Response**

The updated [SSH key resource](#ssh-key-resource).

### DELETE /api/user/ssh-keys/:id

**OAuth scope**: `keys:write`

Deletes this SSH key resource.

### GET /api/user/pgp-keys
**OAuth scope**: `keys:write`

**OAuth scope**: `keys:read`
### GET /api/user/pgp-keys

List of [PGP key resources](#pgp-key-resource).

### POST /api/user/pgp-keys
**OAuth scope**: `keys:read`

**OAuth scope**: `keys:write`
### POST /api/user/pgp-keys

Creates a new [PGP key resource](#pgp-key-resource).

**OAuth scope**: `keys:write`

**Request body**

```json


@@ 190,16 190,16 @@ The new [PGP key resource](#pgp-key-resource).

### GET /api/user/pgp-keys/:id

**OAuth scope**: `keys:read`

Retrieves a [PGP key resource](#pgp-key-resource).

### DELETE /api/user/pgp-keys/:id
**OAuth scope**: `keys:read`

**OAuth scope**: `keys:write`
### DELETE /api/user/pgp-keys/:id

Deletes this PGP key resource.

**OAuth scope**: `keys:write`

## Webhooks

### /api/user/...


@@ 209,30 209,30 @@ endpoints](../api-conventions.md#webhooks)

#### profile:update

**OAuth scope**: `profile:read`

Issued when the user's profile (bio, email, etc) is updated.

**OAuth scope**: `profile:read`

**Request body**

The updated [user resource](#user-resource).

#### ssh-key:add

**OAuth scope**: `keys:read`

Issued when the user adds an SSH key to their account.

**OAuth scope**: `keys:read`

**Request body**

The new [SSH key resource](#ssh-key-resource).

#### ssh-key:remove

**OAuth scope**: `keys:read`

Issued when the user removes an SSH key from their account.

**OAuth scope**: `keys:read`

**Request body**

```json


@@ 243,20 243,20 @@ Issued when the user removes an SSH key from their account.

#### pgp-key:add

**OAuth scope**: `keys:read`

Issued when the user adds a PGP key to their account.

**OAuth scope**: `keys:read`

**Request body**

The new [PGP key resource](#pgp-key-resource).

#### pgp-key:remove

**OAuth scope**: `keys:read`

Issued when the user removes a PGP key from their account.

**OAuth scope**: `keys:read`

**Request body**

```json

M paste.sr.ht/api.md => paste.sr.ht/api.md +7 -5
@@ 75,16 75,16 @@ The new [paste resource](#paste-resource).

### GET /api/pastes/:sha

**OAuth scope**: `pastes:read`

Retrieves a [paste resource](#paste-resource).

### GET /api/blobs/:sha

**OAuth scope**: `pastes:read`

### GET /api/blobs/:sha

Retrieves a [blob resource](#blob-resource).

**OAuth scope**: `pastes:read`

## Webhooks

### /api/pastes/...


@@ 94,7 94,9 @@ endpoints](../api-conventions.md#webhooks)

#### paste:create

Issued when a new paste is created. Requires `paste:read` OAuth scope. 
Issued when a new paste is created.

**OAuth scope**: `paste:read`

**Request body**