$schema: https://json-schema.org/draft/2020-12/schema
$id: OrgPatchData.yaml
type: object
properties:
  name:
    type: string
    description: The name this organization is known by; for a legal entity, its legal name.
  status:
    anyOf:
      - $ref: OrgPatchOrgStatusOrCreate.yaml
      - type: "null"
    description: Whether the organization exists and operates, or has dissolved or ceased operating.
  mission:
    anyOf:
      - type: string
      - type: "null"
    description: The organization's mission statement.
  yearFounded:
    anyOf:
      - $ref: calendarYear.yaml
      - type: "null"
    description: The calendar year the organization was founded.
  aliases:
    anyOf:
      - type: array
        items:
          $ref: nonEmptyString.yaml
      - type: "null"
    uniqueItems: true
    description: Other names this organization goes by, such as a trading name or a short form of its legal name. Not a history of former names. Don't list a name that has its own live trading-name record linked to this organization by a `dba` entry in either record; see the organization relationships guide.
  identifiers:
    anyOf:
      - $ref: "#/$defs/OrgPatchOrgIdsOrCreate"
      - type: "null"
    description: Identifiers associated with the organization, keyed by registry code.
  orgType:
    anyOf:
      - $ref: "#/$defs/OrgPatchPCSOrgTypeOrCreate"
      - type: "null"
    description: The organization's type within the Philanthropy Classification System (PCS).
  addresses:
    anyOf:
      - $ref: "#/$defs/OrgPatchAddressCollectionOrCreate"
      - type: "null"
    description: Collection of physical addresses associated with the organization.
  phones:
    anyOf:
      - $ref: "#/$defs/OrgPatchPhoneCollectionOrCreate"
      - type: "null"
    description: Collection of phone numbers associated with the organization.
  emails:
    anyOf:
      - $ref: "#/$defs/OrgPatchEmailCollectionOrCreate"
      - type: "null"
    description: Collection of email addresses associated with the organization.
  socials:
    anyOf:
      - $ref: "#/$defs/OrgPatchOrgSocialLinksOrCreate"
      - type: "null"
    description: Collection of the organization's social media and web presence links.
  relationships:
    anyOf:
      - type: object
        properties:
          parents:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgHierarchyRelationshipReplaceOnly"
              - type: "null"
            description: Organizations above this one, such as a containing organization or a fiscal sponsor.
          children:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgHierarchyRelationshipReplaceOnly"
              - type: "null"
            description: Organizations below this one, such as its chapters or sponsored projects.
          succeededBy:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgSuccessionRelationshipReplaceOnly"
              - type: "null"
            description: Organizations that carry on all or part of this one.
          succeeds:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgSuccessionRelationshipReplaceOnly"
              - type: "null"
            description: Organizations whose work this one carries on in whole or in part.
          recordReplacedBy:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgRecordRelationshipReplaceOnly"
              - type: "null"
            description: Records to use instead of this record.
          recordReplaces:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgRecordRelationshipReplaceOnly"
              - type: "null"
            description: Records that this record is used instead of.
          otherRelationships:
            anyOf:
              - type: array
                items:
                  $ref: "#/$defs/OrgPatchOrgOtherRelationshipReplaceOnly"
              - type: "null"
            description: Connections outside the categories above, which need not have a direction.
        unevaluatedProperties:
          not: {}
      - type: "null"
    description: The organization's relationships to other organizations.
  customFields:
    anyOf:
      - type: object
        properties: {}
        unevaluatedProperties:
          anyOf:
            - $ref: OrgPatchCustomFieldOrCreate.yaml
            - type: "null"
      - type: "null"
    description: Custom fields for the organization.
unevaluatedProperties:
  not: {}
examples:
  - name: Example Nonprofit (Renamed)
    mission: To expand access to community health resources.
    yearFounded: null
    socials:
      website: null
    emails:
      primary: info@example.org
    customFields:
      legacyCode: null
description: |-
  A JSON Merge Patch (RFC 7396) body for updating an organization profile.

  Derived from `OrganizationBase`: every field is optional, fields that can
  be cleared accept `null` to unset them, record keys can be deleted by
  setting them to `null`, and read-only fields like `id` are excluded.
  Sent as `application/merge-patch+json`.
$defs:
  OrgPatchOrgIdsOrCreate:
    type: object
    properties:
      org:us:ein:
        anyOf:
          - $ref: OrgPatchOrgIdEinOrCreate.yaml
          - type: "null"
        description: The organization's Employer Identification Number (EIN), assigned by the IRS.
      org:us:uei:
        anyOf:
          - $ref: OrgPatchOrgIdUeiOrCreate.yaml
          - type: "null"
        description: The organization's Unique Entity Identifier (UEI) from SAM.gov.
      org:xi:duns:
        anyOf:
          - $ref: OrgPatchOrgIdDunsOrCreate.yaml
          - type: "null"
        description: The organization's Data Universal Numbering System (DUNS) number.
      systemId:
        anyOf:
          - $ref: OrgPatchSystemIdOrCreate.yaml
          - type: "null"
        description: The hosting system's own identifier for this record.
      otherIds:
        anyOf:
          - type: object
            properties: {}
            unevaluatedProperties:
              anyOf:
                - $ref: OrgPatchIdentifierOrCreate.yaml
                - type: "null"
          - type: "null"
        description: |-
          Additional identifiers keyed by their registry code, for registries the
          protocol does not define as a base identifier on the model.
    unevaluatedProperties:
      not: {}
    description: |-
      A collection of identifiers associated with an organization.

      Extends the generic identifier collection with the base identifiers CommonGrants
      defines for organizations. Additional registries can be published under `otherIds`.
  OrgPatchPCSOrgTypeOrCreate:
    type: object
    properties:
      class:
        type: string
        const: Organization types
        description: The PCS term for the organization type.
      term:
        type: string
        description: The plain language PCS term.
      code:
        type: string
        examples:
          - UC000000
        pattern: ^[A-Z]{2}[0-9]{6}$
        description: The code for this PCS term.
      description:
        anyOf:
          - type: string
          - type: "null"
        description: Description of the PCS term
    unevaluatedProperties:
      not: {}
    description: |-
      A Philanthropy Classification System (PCS) term for organization types.

      See https://taxonomy.candid.org/organization-type for more information.
  OrgPatchAddressCollectionOrCreate:
    type: object
    properties:
      primary:
        $ref: OrgPatchAddressOrCreate.yaml
        description: The primary address for a person or organization.
      otherAddresses:
        anyOf:
          - type: object
            properties: {}
            unevaluatedProperties:
              anyOf:
                - $ref: OrgPatchAddressOrCreate.yaml
                - type: "null"
          - type: "null"
        description: Additional addresses keyed by a descriptive label (e.g., "work", "home", "international").
    unevaluatedProperties:
      not: {}
    description: A collection of addresses.
  OrgPatchPhoneCollectionOrCreate:
    type: object
    properties:
      primary:
        $ref: OrgPatchPhoneOrCreate.yaml
        description: The person's primary phone number.
      fax:
        anyOf:
          - $ref: OrgPatchPhoneOrCreate.yaml
          - type: "null"
        description: The person's fax number, if applicable.
      otherPhones:
        anyOf:
          - type: object
            properties: {}
            unevaluatedProperties:
              anyOf:
                - $ref: OrgPatchPhoneOrCreate.yaml
                - type: "null"
          - type: "null"
        description: Additional phone numbers not covered by the standard fields.
    unevaluatedProperties:
      not: {}
    description: A collection of phone numbers for a person.
  OrgPatchEmailCollectionOrCreate:
    type: object
    properties:
      primary:
        $ref: email.yaml
        description: The primary email address for a person or organization.
      otherEmails:
        anyOf:
          - type: object
            properties: {}
            unevaluatedProperties:
              anyOf:
                - $ref: email.yaml
                - type: "null"
          - type: "null"
        description: Additional email addresses keyed by a descriptive label (e.g., "work", "personal", "support").
    unevaluatedProperties:
      not: {}
    description: A collection of email addresses.
  OrgPatchOrgSocialLinksOrCreate:
    type: object
    properties:
      website:
        anyOf:
          - type: string
            format: uri
          - type: "null"
        description: The organization's primary website URL.
      facebook:
        anyOf:
          - type: string
            format: uri
          - type: "null"
        description: The organization's Facebook profile URL.
      twitterOrX:
        anyOf:
          - type: string
            format: uri
          - type: "null"
        description: The organization's Twitter/X profile URL.
      bluesky:
        anyOf:
          - type: string
            format: uri
          - type: "null"
        description: The organization's BlueSky profile URL.
      instagram:
        anyOf:
          - type: string
            format: uri
          - type: "null"
        description: The organization's Instagram profile URL.
      linkedin:
        anyOf:
          - type: string
            format: uri
          - type: "null"
        description: The organization's LinkedIn profile URL.
      otherSocials:
        anyOf:
          - type: object
            properties: {}
            unevaluatedProperties:
              anyOf:
                - type: string
                  format: uri
                - type: "null"
          - type: "null"
        description: Additional social media profiles not covered by the standard fields.
    unevaluatedProperties:
      not: {}
    description: A collection of social media and web presence links for an organization.
  OrgPatchOrgHierarchyRelationshipReplaceOnly:
    type: object
    properties:
      org:
        $ref: "#/$defs/OrgPatchOrgTargetRefReplaceOnly"
        description: The other organization, which a writer can name by `id` alone.
      kind:
        type: object
        properties:
          value:
            $ref: OrgHierarchyKindOptions.yaml
            description: The selected value, from a predefined set of options
          customValue:
            type: string
            description: A custom value, used when the selected value is the `custom` option
          description:
            type: string
            description: A human-readable description of the value
        required:
          - value
        unevaluatedProperties:
          not: {}
        description: The relationship's subtype within the category its list names.
      startDate:
        $ref: isoDate.yaml
        description: "When the relationship started, in ISO 8601 format: YYYY-MM-DD"
      endDate:
        $ref: isoDate.yaml
        description: "When the relationship ended, in ISO 8601 format: YYYY-MM-DD"
      status:
        $ref: OrgRelationshipStatus.yaml
        description: Whether the relationship is in effect, as stated by the provider.
    required:
      - org
    unevaluatedProperties:
      not: {}
    description: A parent or child relationship, as written.
  OrgPatchOrgSuccessionRelationshipReplaceOnly:
    type: object
    properties:
      org:
        $ref: "#/$defs/OrgPatchOrgTargetRefReplaceOnly"
        description: The other organization, which a writer can name by `id` alone.
      kind:
        type: object
        properties:
          value:
            $ref: OrgSuccessionKindOptions.yaml
            description: The selected value, from a predefined set of options
          customValue:
            type: string
            description: A custom value, used when the selected value is the `custom` option
          description:
            type: string
            description: A human-readable description of the value
        required:
          - value
        unevaluatedProperties:
          not: {}
        description: The relationship's subtype within the category its list names.
      startDate:
        $ref: isoDate.yaml
        description: "When the relationship started, in ISO 8601 format: YYYY-MM-DD"
      endDate:
        $ref: isoDate.yaml
        description: "When the relationship ended, in ISO 8601 format: YYYY-MM-DD"
      status:
        $ref: OrgRelationshipStatus.yaml
        description: Whether the relationship is in effect, as stated by the provider.
    required:
      - org
    unevaluatedProperties:
      not: {}
    description: A succession relationship, as written.
  OrgPatchOrgRecordRelationshipReplaceOnly:
    type: object
    properties:
      org:
        $ref: "#/$defs/OrgPatchOrgTargetRefReplaceOnly"
        description: The other organization, which a writer can name by `id` alone.
      kind:
        type: object
        properties:
          value:
            $ref: OrgRecordKindOptions.yaml
            description: The selected value, from a predefined set of options
          customValue:
            type: string
            description: A custom value, used when the selected value is the `custom` option
          description:
            type: string
            description: A human-readable description of the value
        required:
          - value
        unevaluatedProperties:
          not: {}
        description: The relationship's subtype within the category its list names.
      startDate:
        $ref: isoDate.yaml
        description: "When the relationship started, in ISO 8601 format: YYYY-MM-DD"
      endDate:
        $ref: isoDate.yaml
        description: "When the relationship ended, in ISO 8601 format: YYYY-MM-DD"
      status:
        $ref: OrgRelationshipStatus.yaml
        description: Whether the relationship is in effect, as stated by the provider.
    required:
      - org
    unevaluatedProperties:
      not: {}
    description: A record replacement relationship, as written.
  OrgPatchOrgOtherRelationshipReplaceOnly:
    type: object
    properties:
      org:
        $ref: "#/$defs/OrgPatchOrgTargetRefReplaceOnly"
        description: The other organization, which a writer can name by `id` alone.
      kind:
        type: object
        properties:
          value:
            $ref: OrgOtherKindOptions.yaml
            description: The selected value, from a predefined set of options
          customValue:
            type: string
            description: A custom value, used when the selected value is the `custom` option
          description:
            type: string
            description: A human-readable description of the value
        required:
          - value
        unevaluatedProperties:
          not: {}
        description: The relationship's subtype within the category its list names.
      startDate:
        $ref: isoDate.yaml
        description: "When the relationship started, in ISO 8601 format: YYYY-MM-DD"
      endDate:
        $ref: isoDate.yaml
        description: "When the relationship ended, in ISO 8601 format: YYYY-MM-DD"
      status:
        $ref: OrgRelationshipStatus.yaml
        description: Whether the relationship is in effect, as stated by the provider.
    required:
      - org
    unevaluatedProperties:
      not: {}
    description: A relationship outside the named categories, as written.
  OrgPatchOrgTargetRefReplaceOnly:
    type: object
    properties:
      id:
        $ref: uuid.yaml
        description: The other organization's unique identifier.
      name:
        type: string
        description: "The other organization's name. Ignored if supplied: the receiver fills it in from its own record."
      identifiers:
        type: object
        properties:
          org:us:ein:
            type: object
            properties:
              registry:
                type: object
                properties:
                  code:
                    type: string
                    const: org:us:ein
                    description: Canonical CommonGrants registry code, `<schema>:<scope>:<prop>` (e.g. `org:us:ein`).
                  url:
                    type: string
                    format: uri
                    description: Link to the catalog entry for this registry.
                unevaluatedProperties:
                  not: {}
                description: Registry-level facts shared by every record in this registry.
              id:
                $ref: employerTaxId.yaml
                description: |-
                  The primary identifier string, when the registry has a single canonical value.

                  May be omitted for registries with no natural primary; consumers should read
                  `allIds` in that case.
              allIds:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: employerTaxId.yaml
                      description: The identifier string.
                    status:
                      $ref: IdentifierStatus.yaml
                      description: Whether the identifier is currently valid or retired.
                  required:
                    - id
                    - status
                  unevaluatedProperties:
                    not: {}
                description: Every known identifier for this record in this registry, including archived values.
            unevaluatedProperties:
              not: {}
            description: The organization's Employer Identification Number (EIN), assigned by the IRS.
          org:us:uei:
            type: object
            properties:
              registry:
                type: object
                properties:
                  code:
                    type: string
                    const: org:us:uei
                    description: Canonical CommonGrants registry code, `<schema>:<scope>:<prop>` (e.g. `org:us:ein`).
                  url:
                    type: string
                    format: uri
                    description: Link to the catalog entry for this registry.
                unevaluatedProperties:
                  not: {}
                description: Registry-level facts shared by every record in this registry.
              id:
                $ref: samUEI.yaml
                description: |-
                  The primary identifier string, when the registry has a single canonical value.

                  May be omitted for registries with no natural primary; consumers should read
                  `allIds` in that case.
              allIds:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: samUEI.yaml
                      description: The identifier string.
                    status:
                      $ref: IdentifierStatus.yaml
                      description: Whether the identifier is currently valid or retired.
                  required:
                    - id
                    - status
                  unevaluatedProperties:
                    not: {}
                description: Every known identifier for this record in this registry, including archived values.
            unevaluatedProperties:
              not: {}
            description: The organization's Unique Entity Identifier (UEI) from SAM.gov.
          org:xi:duns:
            type: object
            properties:
              registry:
                type: object
                properties:
                  code:
                    type: string
                    const: org:xi:duns
                    description: Canonical CommonGrants registry code, `<schema>:<scope>:<prop>` (e.g. `org:us:ein`).
                  url:
                    type: string
                    format: uri
                    description: Link to the catalog entry for this registry.
                unevaluatedProperties:
                  not: {}
                description: Registry-level facts shared by every record in this registry.
              id:
                $ref: duns.yaml
                description: |-
                  The primary identifier string, when the registry has a single canonical value.

                  May be omitted for registries with no natural primary; consumers should read
                  `allIds` in that case.
              allIds:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: duns.yaml
                      description: The identifier string.
                    status:
                      $ref: IdentifierStatus.yaml
                      description: Whether the identifier is currently valid or retired.
                  required:
                    - id
                    - status
                  unevaluatedProperties:
                    not: {}
                description: Every known identifier for this record in this registry, including archived values.
            unevaluatedProperties:
              not: {}
            description: The organization's Data Universal Numbering System (DUNS) number.
          systemId:
            type: object
            properties:
              registry:
                type: object
                properties:
                  code:
                    type: string
                    description: Canonical CommonGrants registry code, `<schema>:<scope>:<prop>` (e.g. `org:us:ein`).
                  url:
                    type: string
                    format: uri
                    description: Link to the catalog entry for this registry.
                unevaluatedProperties:
                  not: {}
                description: Registry-level facts shared by every record in this registry.
              id:
                $ref: uuid.yaml
                description: |-
                  The primary identifier string, when the registry has a single canonical value.

                  May be omitted for registries with no natural primary; consumers should read
                  `allIds` in that case.
              allIds:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: uuid.yaml
                      description: The identifier string.
                    status:
                      $ref: IdentifierStatus.yaml
                      description: Whether the identifier is currently valid or retired.
                  required:
                    - id
                    - status
                  unevaluatedProperties:
                    not: {}
                description: Every known identifier for this record in this registry, including archived values.
            unevaluatedProperties:
              not: {}
            description: The hosting system's own identifier for this record.
          otherIds:
            type: object
            properties: {}
            unevaluatedProperties:
              type: object
              properties:
                registry:
                  type: object
                  properties:
                    code:
                      type: string
                      description: Canonical CommonGrants registry code, `<schema>:<scope>:<prop>` (e.g. `org:us:ein`).
                    url:
                      type: string
                      format: uri
                      description: Link to the catalog entry for this registry.
                  unevaluatedProperties:
                    not: {}
                  description: Registry-level facts shared by every record in this registry.
                id:
                  type: string
                  description: |-
                    The primary identifier string, when the registry has a single canonical value.

                    May be omitted for registries with no natural primary; consumers should read
                    `allIds` in that case.
                allIds:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The identifier string.
                      status:
                        $ref: IdentifierStatus.yaml
                        description: Whether the identifier is currently valid or retired.
                    required:
                      - id
                      - status
                    unevaluatedProperties:
                      not: {}
                  description: Every known identifier for this record in this registry, including archived values.
              unevaluatedProperties:
                not: {}
            description: |-
              Additional identifiers keyed by their registry code, for registries the
              protocol does not define as a base identifier on the model.
        unevaluatedProperties:
          not: {}
        description: "Identifiers associated with the other organization, keyed by registry code. Ignored if supplied: the receiver fills them in from its own record."
    required:
      - id
    unevaluatedProperties:
      not: {}
    description: |-
      A writable reference to a relationship's other organization.

      Unlike `Models.OrgRef`, whose `id` is read-only, `id` is writable here so a
      patch can name the other organization, and the rest is optional so it can
      be named by `id` alone. The receiver identifies the target by `id` and
      rejects an `id` it doesn't recognize. It ignores a supplied `name` and
      `identifiers` and fills both in from its own record on reads and revision
      snapshots. They stay accepted, rather than read-only, so a writer can
      resend entries copied from a read: read-only members would be dropped
      from this closed schema, which would then reject them. Schema validation
      checks only this shape; it does not look up or fill in the target.
