> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scoutforschools.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a master agreement PDF for a student

> Uploads a signed master agreement PDF for the given student and associates
it with the current or provided school year. The agreement is auto-approved
(no in-app signature flow) and any prior agreement document for that
student + school year is replaced. The student must already have a Teacher
of Record when no agreement exists yet. Staff sessions and API token
authentication (scope: `master-agreements`) are accepted; only PDF files
are allowed.




## OpenAPI

````yaml /api-reference/openapi.json post /student/{studentId}/master-agreements/upload
openapi: 3.1.0
info:
  title: Scout API
  version: 1.0.0
  description: >-
    Programmatic access to Scout rostering data (IMS OneRoster 1.1 & 1.2) and
    related endpoints, authenticated with an API access token.
servers:
  - url: https://api.teachwithscout.com/v1
    description: Production
security: []
tags:
  - name: Access tokens
  - name: Attendance
  - name: Enrollment invitations
  - name: Enrollment submissions
  - name: Master agreements
  - name: Staff associations
  - name: OneRoster 1.1
  - name: OneRoster 1.2
paths:
  /student/{studentId}/master-agreements/upload:
    post:
      tags:
        - Master agreements
      summary: Upload a master agreement PDF for a student
      description: >
        Uploads a signed master agreement PDF for the given student and
        associates

        it with the current or provided school year. The agreement is
        auto-approved

        (no in-app signature flow) and any prior agreement document for that

        student + school year is replaced. The student must already have a
        Teacher

        of Record when no agreement exists yet. Staff sessions and API token

        authentication (scope: `master-agreements`) are accepted; only PDF files

        are allowed.
      parameters:
        - name: studentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Master Agreement PDF file
                data:
                  type: object
                  properties:
                    lastSignatureDate:
                      type: string
                      format: date
                      description: >-
                        Optional date the agreement was last signed
                        (YYYY-MM-DD). Cannot be in the future or after the end
                        of the school year.
                    friendlyName:
                      type: string
                      description: Optional display name for the document
                    schoolYearId:
                      type: string
                      description: >-
                        Optional school year ID. If not provided, the backend
                        will use the current or upcoming school year.
                    tags:
                      type: array
                      items:
                        type: string
                      description: Optional tags to associate with the document
              required:
                - file
      responses:
        '201':
          description: Successfully uploaded master agreement
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  masterAgreementId:
                    type: string
                  documentId:
                    type: string
                required:
                  - success
                  - masterAgreementId
                  - documentId
        '400':
          description: >-
            No file was sent, the file isn't a PDF, `data.schoolYearId` is not
            the id of a school year in this district, or lastSignatureDate isn't
            a valid date, is in the future, or is after the end of the school
            year (body `{success: false, message}`). A request that isn't a
            valid `multipart/form-data` upload, such as a JSON body or a missing
            boundary, is refused with body `{status, message}`.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                    required:
                      - success
                      - message
                  - type: object
                    properties:
                      status:
                        type: integer
                        example: 400
                      message:
                        type: string
                    required:
                      - status
                      - message
        '401':
          description: The access token is missing, invalid, expired or revoked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 401
                  error:
                    type: string
                  code:
                    type: string
                    example: INVALID_ACCESS_TOKEN
                required:
                  - status
                  - error
                  - code
        '403':
          description: >-
            Either the API token lacks the `master-agreements` scope (body
            `{success: false, message}`), or the staff user's role may not
            upload master agreements (body `{status, message}`).
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      success:
                        type: boolean
                        example: false
                      message:
                        type: string
                    required:
                      - success
                      - message
                  - type: object
                    properties:
                      status:
                        type: integer
                        example: 403
                      message:
                        type: string
                    required:
                      - status
                      - message
        '404':
          description: No student with this id is visible to the caller.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                required:
                  - success
                  - message
        '409':
          description: >-
            A concurrent upload for the same student and school year wrote the
            agreement first; retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                required:
                  - success
                  - message
        '413':
          description: The file is larger than 100 MB.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                required:
                  - success
                  - message
      security:
        - accessToken: []
components:
  securitySchemes:
    accessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer access token from `POST /oauth/token` (OAuth 2.0 client
        credentials; the OneRoster `/ims/oneroster/v1p1/token` and `/v1p2/token`
        URLs are aliases). Send it as `Authorization: Bearer <access_token>`.
        Tokens expire after 1 hour and carry your API client's granted scopes —
        an endpoint outside them returns 403.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.