{
  "$id": "https://intentschema.org/intents/productivity/contacts/contact/get/v1.json",
  "fqdn": "org.intentschema.productivity.contacts.contact.get.v1",
  "title": "Get contact",
  "description": "Fetch a single contact by id.",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "allOf": [
          {
            "$ref": "https://intentschema.org/common/target/v1.json"
          },
          {
            "required": [
              "external_id"
            ]
          }
        ]
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "external_id"
    ],
    "properties": {
      "external_id": {
        "type": "string"
      },
      "object": {
        "type": "object",
        "properties": {
          "given_name": {
            "type": "string"
          },
          "family_name": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "organization": {
            "type": "string"
          },
          "job_title": {
            "type": "string"
          }
        }
      },
      "etag": {
        "type": "string"
      }
    }
  },
  "examples": [
    {
      "name": "fetch by id",
      "value": {
        "target": {
          "system": "google_contacts",
          "external_id": "contact_abc"
        }
      }
    }
  ]
}
