openapi: 3.1.0
info:
  title: Brand Notes API
  version: v11
  description: "Manage internal plaintext records about partners. Notes are visible to all members \nof your impact.com account but are hidden from the partners themselves. \nNotes support attachments and categorization by interaction type.\n"
servers:
- url: https://api.impact.com
security:
- basicAuth: []
paths:
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}/Notes:
    get:
      operationId: listNotes
      tags:
      - Notes
      summary: List all notes
      description: Returns a list of notes ordered chronologically by creation date.
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        description: The ID of the campaign to retrieve notes from.
        schema:
          type: integer
      - name: MediaId
        in: query
        description: Filter notes by a specific partner account ID.
        schema:
          type: integer
      - name: StartDate
        in: query
        description: Retrieve notes created after this date (ISO 8601).
        schema:
          type: string
          format: date-time
      - name: EndDate
        in: query
        description: Retrieve notes created before this date (ISO 8601).
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: A list of note objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Notes:
                    type: array
                    description: The list of note objects.
                    items:
                      $ref: '#/components/schemas/Note'
    post:
      operationId: createNote
      tags:
      - Notes
      summary: Create a note
      description: "Creates a new note about a partner. Requires either Content or an Attachment. \nUse multipart/form-data for file uploads.\n"
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        description: The ID of the campaign to create the note in.
        schema:
          type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - MediaId
              properties:
                MediaId:
                  type: integer
                  description: The partner account ID this note is for.
                  example: 10000
                Content:
                  type: string
                  description: The plaintext content of the note. Optional if an Attachment is provided.
                  example: Following up on this partner.
                Attachment:
                  type: string
                  format: binary
                  description: An image file to upload as an attachment. Optional if Content is provided.
                Type:
                  type: string
                  description: The interaction type for this note.
                  enum:
                  - EMAIL
                  - IM
                  - NONE
                  - PHONE
                  default: NONE
      responses:
        '200':
          description: The note was created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteStatusResponse'
  /Advertisers/{AccountSID}/Campaigns/{CampaignId}/Notes/{NoteId}:
    get:
      operationId: getNote
      tags:
      - Notes
      summary: Retrieve a note
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        description: The ID of the campaign the note belongs to.
        schema:
          type: integer
      - name: NoteId
        in: path
        required: true
        description: The unique identifier for the note.
        schema:
          type: integer
      responses:
        '200':
          description: A single note object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
    put:
      operationId: updateNote
      tags:
      - Notes
      summary: Update a note
      description: Updates specific note fields. Parameters not provided remain unchanged.
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        description: The ID of the campaign the note belongs to.
        schema:
          type: integer
      - name: NoteId
        in: path
        required: true
        description: The unique identifier for the note to update.
        schema:
          type: integer
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                Content:
                  type: string
                  description: The new plaintext content for the note.
                  example: Updated note content.
                Type:
                  type: string
                  description: The interaction type for this note.
                  enum:
                  - EMAIL
                  - IM
                  - NONE
                  - PHONE
                AttachmentsAdd:
                  type: string
                  format: binary
                  description: An image file to add as a new attachment.
                AttachmentsRemove:
                  type: string
                  description: impact.com internal name for the file to be deleted.
                  example: 1,2
      responses:
        '200':
          description: The note was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteStatusResponse'
    delete:
      operationId: deleteNote
      tags:
      - Notes
      summary: Delete a note
      parameters:
      - name: AccountSID
        in: path
        required: true
        description: The unique identifier for the account.
        schema:
          type: string
      - name: CampaignId
        in: path
        required: true
        description: The ID of the campaign the note belongs to.
        schema:
          type: integer
      - name: NoteId
        in: path
        required: true
        description: The unique identifier for the note to delete.
        schema:
          type: integer
      responses:
        '200':
          description: The note was deleted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    description: Indicates that the note was deleted.
                    example: DELETED
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    Note:
      type: object
      properties:
        Id:
          type: integer
          description: The unique identifier for the note.
          example: 123456
        MediaId:
          type: integer
          description: The unique identifier of the partner this note is about.
          example: 10000
        MediaName:
          type: string
          description: The display name of the partner this note is about.
          example: Acme Partner
        Creator:
          type: string
          description: The name of the user who created the note.
          example: Brand Man
        CreationDate:
          type: string
          format: date-time
          description: The date and time the note was created.
          example: '2020-09-10T10:51:23-07:00'
        ModificationDate:
          type: string
          format: date-time
          description: The date and time the note was last modified.
          example: '2020-10-21T14:51:42-07:00'
        Content:
          type: string
          description: The plaintext content of the note.
          example: Meep Meep
        Type:
          type: string
          description: The interaction type for this note.
          enum:
          - EMAIL
          - IM
          - NONE
          - PHONE
          example: NONE
        Attachments:
          type: array
          description: URIs of file attachments associated with the note.
          items:
            type: string
            format: uri-reference
            example: /Advertisers/<AccountSID>/Campaigns/1000/Notes/2750/Attachments/1
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to this note in the impact.com API.
          example: /Advertisers/<AccountSID>/Campaigns/1000/Notes/123456
    NoteStatusResponse:
      type: object
      properties:
        Status:
          type: string
          description: Indicates whether the operation was successful.
          example: OK
        Uri:
          type: string
          format: uri-reference
          description: The unique reference to the affected note.
          example: /Advertisers/<AccountSID>/Campaigns/1000/Notes/2750
