---
swagger: '2.0'
info:
  version: 1.0.0
  title: GiveCampus Contact Reports API
  description: |-
    The Contact Reports API allows your school to submit contact report data to GiveCampus in JSON format. <h2>Security</h2> <p>All requests require a bearer token via the Authorization header, generated by a school administrator in the GiveCampus UI.</p> <p>All API responses are delivered over HTTPS and require TLS 1.2 or 1.3.</p> <h2>Request Lifecycle</h2> <p>The API delivers data asynchronously using a request-and-poll pattern:</p> <ol>
      <li><strong>Submit your request</strong> — Call the endpoint with your desired parameters. You'll receive a <code>request_id</code> and a <code>status</code> of <code>in_progress</code>.</li>
      <li><strong>Poll for results</strong> — Call <code>/results/{request_id}</code> every 2–5 seconds until <code>status</code> changes to <code>completed</code> (or <code>error</code>).</li>
      <li><strong>Download your data</strong> — When complete, the response includes a <code>download_url</code> containing a JSON array of objects matching the model defined below.</li>
    </ol> <p>Most requests complete within a few seconds.</p> <h2>Testing</h2> <p>Use the "Try it out" button to test and inspect API behavior before integrating.</p> <p><i>GiveCampus Proprietary and Confidential</i></p>
basePath: "/api"
securityDefinitions:
  Bearer:
    type: apiKey
    name: Authorization
    in: header
    description: Enter the token with the `Bearer ` prefix, e.g. "Bearer XXXXXXXXXXXXX".
paths:
  "/contact_reports/search":
    post:
      tags:
      - Contact Reports
      summary: Search contact reports
      description: 'Search for contact reports based on various criteria. Returns
        a list of matching contact reports.

        '
      operationId: searchContactReports
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: search_request
        required: true
        schema:
          type: object
          "$ref": "#/definitions/SearchContactReport"
      security:
      - Bearer: []
      responses:
        '200':
          description: Submitted successfully. Returns a request ID.
          schema:
            "$ref": "#/definitions/ApiRequest"
        '400':
          description: Invalid request. Check required fields.
  "/contact_reports":
    post:
      tags:
      - Contact Reports
      summary: Submit contact reports
      description: Submit one or more contact reports. Each contact report must include
        required fields and can optionally include task or custom field information.
      operationId: createContactReports
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: contact_reports
        required: true
        schema:
          type: array
          items:
            "$ref": "#/definitions/CreateContactReport"
      security:
      - Bearer: []
      responses:
        '200':
          description: Submitted successfully. Returns a request ID.
          schema:
            "$ref": "#/definitions/ApiRequest"
        '400':
          description: Invalid request. Check required fields.
    put:
      tags:
      - Contact Reports
      summary: Update contact reports
      description: Submit one or more contact reports. Each contact report must include
        required fields and can optionally include task or custom field information.
      operationId: updateContactReports
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: contact_reports
        required: true
        schema:
          type: array
          items:
            "$ref": "#/definitions/UpdateContactReport"
      security:
      - Bearer: []
      responses:
        '200':
          description: Submitted successfully. Returns a request ID.
          schema:
            "$ref": "#/definitions/ApiRequest"
        '400':
          description: Invalid request. Check required fields.
  "/results/{request_id}":
    get:
      tags:
      - Results
      summary: Get processing results
      description: Returns status and download URL once the submitted contact reports
        have been processed.
      operationId: getContactReportResults
      produces:
      - application/json
      parameters:
      - in: path
        name: request_id
        type: string
        required: true
        description: Request ID returned from submission
      security:
      - Bearer: []
      responses:
        '200':
          description: Status and download URL
          schema:
            "$ref": "#/definitions/ApiResults"
        '202':
          description: returns a status for your request
          schema:
            "$ref": "../shared/types/in_progress_api_results.yaml"
        '400':
          description: Invalid request
definitions:
  SearchContactReport:
    type: object
    properties:
      ids:
        type: array
        items:
          type: string
        description: Filter by contact report external IDs
      constituent_external_ids:
        type: array
        items:
          type: string
        description: Filter by constituent external IDs
      gift_officer_external_ids:
        type: array
        items:
          type: string
        description: Filter by gift officer external IDs
      date_of_interaction:
        type: integer
        description: Filter by contact reports on or after this date (Unix timestamp
          in seconds)
      created_at:
        type: integer
        description: Filter by contact reports created on or after this date (Unix
          timestamp in seconds)
      last_updated_at:
        type: integer
        description: Filter by contact reports last updated on or after this date
          (Unix timestamp in seconds)
  CreateContactReport:
    type: object
    required:
    - external_id
    - primary_person_external_id
    - primary_gift_officer
    properties:
      external_id:
        type: string
        example: CR-2023-001
      title:
        type: string
      content:
        type: string
      date_of_interaction:
        type: integer
        description: Unix timestamp in seconds
      is_significant:
        type: boolean
      primary_person_external_id:
        type: string
      participant_people_external_ids:
        type: array
        items:
          type: string
      gift_officer_contact_method:
        type: string
        description: Must match the name of one of the configured contact methods
          in GiveCampus
      custom_attribute:
        type: string
        description: The name of the custom attribute to link to this contact report.
          The attribute plus its type resolve to a single custom attribute on the
          contact report. If the attribute does not exist it is created; a soft-deleted
          match is restored. Attributes created via this API default to selectable
          = true. Omit or leave blank to leave no custom attribute set.
      custom_attribute_type:
        type: string
        description: The name of the custom attribute's type. Used together with custom_attribute
          to disambiguate which attribute to link, since the same attribute name can
          exist under multiple types. If the type does not exist it is created; a
          soft-deleted match is restored.
      primary_gift_officer:
        type: object
        required:
        - external_id
        properties:
          external_id:
            type: string
          email:
            type: string
          team:
            type: string
      secondary_gift_officers:
        type: array
        items:
          type: object
          properties:
            external_id:
              type: string
            email:
              type: string
            team:
              type: string
      created_by_task:
        type: object
        properties:
          external_id:
            type: string
          state:
            type: string
            enum:
            - completed
            - upcoming
            - dismissed
            - postponed
          due_date:
            type: integer
            description: Unix timestamp in seconds
          title:
            type: string
          type:
            type: string
            enum:
            - planned_outreach
            - reminder
            - recommended
            - other
          finished_at:
            type: integer
            description: Unix timestamp in seconds
          description:
            type: string
          notification_reminder_days_before_due:
            type: integer
            description: Number of days before due date to send notification reminder
          person_external_id:
            type: string
          gift_officer_external_id:
            type: string
      custom_field_boolean_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Interested in volunteering
            value:
              type: boolean
              example: true
      custom_field_date_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Follow-up date
            value:
              type: integer
              example: 1735689600
              description: Unix timestamp in seconds
      custom_field_float_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Estimated donation amount
            value:
              type: number
              format: float
              example: 100.5
      custom_field_selected_list_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Preferred contact method
            value:
              type: string
              example: Email
      custom_field_string_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Notes
            value:
              type: string
              example: Discussed upcoming events and fundraising goals
  UpdateContactReport:
    type: object
    required:
    - external_id
    - primary_person_external_id
    - primary_gift_officer
    properties:
      external_id:
        type: string
        description: Must match an existing contact report's external ID
        example: CR-2023-001
      title:
        type: string
      content:
        type: string
      date_of_interaction:
        type: integer
        description: Unix timestamp in seconds
      is_significant:
        type: boolean
      user_email:
        type: string
        description: Email of the user who made the update. Used to set the updated-by
          user on the contact report.
      primary_person_external_id:
        type: string
      participant_people_external_ids:
        type: array
        items:
          type: string
      gift_officer_contact_method:
        type: string
        description: Must match the name of one of the configured contact methods
          in GiveCampus
      custom_attribute:
        type: string
        description: The name of the custom attribute to link to this contact report.
          The attribute plus its type resolve to a single custom attribute on the
          contact report. If the attribute does not exist it is created; a soft-deleted
          match is restored. Attributes created via this API default to selectable
          = true. Following update (replace) semantics, sending a blank value clears
          any existing custom attribute.
      custom_attribute_type:
        type: string
        description: The name of the custom attribute's type. Used together with custom_attribute
          to disambiguate which attribute to link, since the same attribute name can
          exist under multiple types. If the type does not exist it is created; a
          soft-deleted match is restored.
      primary_gift_officer:
        type: object
        required:
        - external_id
        properties:
          external_id:
            type: string
          email:
            type: string
          team:
            type: string
      secondary_gift_officers:
        type: array
        items:
          type: object
          properties:
            external_id:
              type: string
            email:
              type: string
            team:
              type: string
      created_by_task:
        type: object
        properties:
          external_id:
            type: string
          state:
            type: string
            enum:
            - completed
            - upcoming
            - dismissed
            - postponed
          due_date:
            type: integer
            description: Unix timestamp in seconds
          title:
            type: string
          type:
            type: string
            enum:
            - planned_outreach
            - reminder
            - recommended
            - other
          finished_at:
            type: integer
            description: Unix timestamp in seconds
          description:
            type: string
          notification_reminder_days_before_due:
            type: integer
            description: Number of days before due date to send notification reminder
          person_external_id:
            type: string
          gift_officer_external_id:
            type: string
      custom_field_boolean_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Interested in volunteering
            value:
              type: boolean
              example: true
      custom_field_date_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Follow-up date
            value:
              type: integer
              example: 1735689600
              description: Unix timestamp in seconds
      custom_field_float_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Estimated donation amount
            value:
              type: number
              format: float
              example: 100.5
      custom_field_selected_list_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Preferred contact method
            value:
              type: string
              example: Email
      custom_field_string_values:
        type: array
        items:
          type: object
          properties:
            custom_field_label:
              type: string
              example: Notes
            value:
              type: string
              example: Discussed upcoming events and fundraising goals
  ContactReport:
    type: object
    description: Response object returned when retrieving contact reports via search
      results download
    properties:
      id:
        type: integer
      external_id:
        type: string
      title:
        type: string
      is_significant:
        type: string
        description: '"Yes" or "No"'
      content:
        type: string
      date_of_interaction:
        type: integer
        description: Unix timestamp in seconds
      creation_source:
        type: string
      primary_person:
        type: object
        properties:
          id:
            type: integer
          constituent_id:
            type: string
      participant_people:
        type: array
        items:
          type: object
          properties:
            id:
              type: integer
            constituent_id:
              type: string
      primary_gift_officer:
        type: object
        properties:
          solicitor_type:
            type: string
          solicitor_id:
            type: string
          team:
            type: string
      secondary_gift_officers:
        type: array
        items:
          type: object
          properties:
            solicitor_type:
              type: string
            solicitor_id:
              type: string
            team:
              type: string
      linked_task:
        type: object
        properties:
          creation_source:
            type: string
          notification_reminder_days_before_due:
            type: integer
          state:
            type: string
          due_date:
            type: integer
            description: Unix timestamp in seconds
          finished_at:
            type: integer
            description: Unix timestamp in seconds
          title:
            type: string
          description:
            type: string
          external_id:
            type: string
          created_at:
            type: integer
            description: Unix timestamp in seconds
          updated_at:
            type: integer
            description: Unix timestamp in seconds
          gift_officer_stage:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              stage_type:
                type: string
      contact_method:
        type: object
        properties:
          name:
            type: string
          selectable:
            type: string
            description: '"Yes" or "No"'
          created_at:
            type: integer
            description: Unix timestamp in seconds
          updated_at:
            type: integer
            description: Unix timestamp in seconds
      custom_attribute:
        type: object
        properties:
          name:
            type: string
          type:
            type: string
            description: The name of the custom attribute's type, if any
          selectable:
            type: string
            description: '"Yes" or "No". Defaults to "Yes" for attributes created
              via this API.'
          created_at:
            type: integer
            description: Unix timestamp in seconds
          updated_at:
            type: integer
            description: Unix timestamp in seconds
      custom_fields:
        type: array
        items:
          type: object
          properties:
            name:
              type: string
            type:
              type: string
            value:
              type: string
      created_at:
        type: integer
        description: Unix timestamp in seconds
      updated_at:
        type: integer
        description: Unix timestamp in seconds
  ApiRequest:
    type: object
    properties:
      request_id:
        type: string
        example: abc123
      state:
        type: string
        example: processing
  ApiResults:
    type: object
    properties:
      request_id:
        type: string
      state:
        type: string
        enum:
        - pending
        - processing
        - completed
        - failed
      download_url:
        type: string
        example: https://givecampus.com/api/downloads/request_id.csv
