# List a contributor's pending submissions

Source: https://docs.musicnerd.net/api-reference/admin/pending-submissions

List a contributor's pending submissions

## GET /api/admin/users/{id}/submissions

Full OpenAPI specification: https://docs.musicnerd.net/spec/admin.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://docs.musicnerd.net/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Music Nerd API: admin",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://musicnerd-api.vercel.app",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/admin/users/{id}/submissions": {
      "get": {
        "summary": "List a contributor's pending submissions",
        "operationId": "listContributorPendingSubmissions",
        "security": [
          {
            "adminBearer": []
          }
        ],
        "description": "The user's own link suggestions and Lore sources (submitted or uploaded) that are still pending, oldest first, across every artist. Returns up to 200, and `hasMore` when there are more.",
        "parameters": [
          {
            "$ref": "#/components/parameters/userId"
          }
        ],
        "responses": {
          "200": {
            "description": "The pending submissions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "items",
                    "hasMore"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "items": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "$ref": "#/components/schemas/PendingSubmission"
                      }
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "`true` when more than 200 are pending; approve these, then list again."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "hasMore": false,
                  "items": [
                    {
                      "id": "5f2d0c1e-8a7b-4c3d-9e1f-0a2b3c4d5e6f",
                      "type": "link",
                      "title": "instagram",
                      "url": "https://instagram.com/dutchyyy",
                      "artistName": "Dutchyyy"
                    },
                    {
                      "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
                      "type": "lore",
                      "title": "Interview with Dutchyyy",
                      "url": "https://example.com/dutchyyy-interview",
                      "artistName": "Dutchyyy"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`id` isn't a UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Invalid user ID"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NotSignedIn"
          },
          "403": {
            "$ref": "#/components/responses/NotAdmin"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "userId": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The contributor's user ID (a UUID).",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "0b1e4c2a-7f3d-4a58-9c61-2d8e5f7a9b10"
      }
    },
    "schemas": {
      "PendingSubmission": {
        "type": "object",
        "required": [
          "id",
          "type",
          "title",
          "url",
          "artistName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "link",
              "lore",
              "upload"
            ],
            "description": "A link suggestion, a Lore source, or an uploaded file."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "The platform for a link, the source title otherwise."
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "artistName": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "NotSignedIn": {
        "description": "No token, an invalid or expired token, or no Music Nerd user for it.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Not signed in"
            }
          }
        }
      },
      "NotAdmin": {
        "description": "The user is not an admin.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Forbidden"
            }
          }
        }
      },
      "InternalError": {
        "description": "The database could not be read or written.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Internal server error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "adminBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Access token",
        "description": "A Music Nerd admin's access token. Copy it at https://musicnerd.net/access after signing in. A signed-in user who is not an admin gets 403."
      }
    }
  }
}
```
