{"_id":"563e184fe79f670d00a10ad5","user":"54e4044e8ef7552300409dcb","__v":19,"version":{"_id":"55fa37c88065a10d004e5bb6","project":"54e405191e51932d006abc39","__v":9,"createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["55fa37ca8065a10d004e5bb7","55fa37ca8065a10d004e5bb8","55fa37ca8065a10d004e5bb9","55fa37ca8065a10d004e5bba","55fca6bf34ae7c0d00ab8ea0","55ff80fd9e7ccf0d000a1d93","560220af7435de0d00fabd0d","56107f21bb9d920d00303e70","563e184077681a0d00d96a02","56fafc6596ec7e0e002ac85f","5915e54f7c2c552d008b8549","59499fcd64b5f5002690bbc1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"REST V3","version_clean":"3.1.0","version":"3.1"},"category":{"_id":"563e184077681a0d00d96a02","__v":2,"pages":["563e201c1347cf0d004182c5","563e20601347cf0d004182c6"],"project":"54e405191e51932d006abc39","version":"55fa37c88065a10d004e5bb6","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-07T15:26:56.680Z","from_sync":false,"order":8,"slug":"subscriptions","title":"Subscriptions"},"parentDoc":null,"project":"54e405191e51932d006abc39","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-07T15:27:11.353Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":0,"body":"Subscription resources are generic user classes that stores a gateway's webhook preferences.\n\n## Subscription Object\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"><div class=\\\"param-table\\\"><div class=\\\"table\\\"><div class=\\\"tr\\\"><div class=\\\"td param\\\"><strong>_id<span class=\\\"colon\\\">:</span></strong></div><div class=\\\"td\\\"><strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Object ID of a subscription object</p>\\n</div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"><strong><span class=\\\"text-muted\\\">_links.self.</span>href<span class=\\\"colon\\\">:</span></strong></div><div class=\\\"td\\\"><strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>HAL style link for the subscription object</p>\\n</div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"><strong>client_id<span class=\\\"colon\\\">:</span></strong></div><div class=\\\"td\\\"><strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>ID of the client who the subscription belongs to</p>\\n</div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"><strong>scope<span class=\\\"colon\\\">:</span></strong></div><div class=\\\"td\\\"><strong class=\\\"param-type\\\">array of strings</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Scope of the webhook subscription</p>\\n</div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"><strong>url<span class=\\\"colon\\\">:</span></strong></div><div class=\\\"td\\\"><strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Webhook url for this subscription</p>\\n</div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"><strong>is_active<span class=\\\"colon\\\">:</span></strong></div><div class=\\\"td\\\"><strong class=\\\"param-type\\\">boolean</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>If the subscription is active or not</p>\\n</div></div></div></div></div></div>\"\n}\n[/block]\n## Scope Syntax\n\nScope tells us when this webhook should be triggered. Following are the ways you can supply scope for subscriptions.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Scope\",\n    \"h-1\": \"Effect\",\n    \"0-0\": \"USERS|POST\",\n    \"0-1\": \"Whenever a user is created with your gateway credentials, you will receive a webhook.\",\n    \"2-0\": \"NODES|POST\",\n    \"2-1\": \"Whenever a node is created for a user registered with your gateway, you will receive a webhook.\",\n    \"4-0\": \"TRANS|POST\",\n    \"4-1\": \"Whenever a transaction is created with your gateway credentials, you will receive a webhook.\",\n    \"1-0\": \"USER|PATCH\",\n    \"1-1\": \"Whenever a user linked to your gateway is updated, you will receive a webhook.\",\n    \"3-0\": \"NODE|PATCH\",\n    \"3-1\": \"Whenever a node linked to a registered user is updated, you will receive a webhook.\",\n    \"5-0\": \"TRAN|PATCH\",\n    \"5-1\": \"Whenever a transaction created with your gateway credentials is updated, you will receive a webhook.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n## HMAC For Web hooks\n\nEvery webhook will be signed with HMAC.\n\nIf you do not know what HMAC is --- it is a protocol that helps you judge the authenticity of the received message. This comes in handy when you want to quickly find out whether the web hook was sent by SynapsePay or a malicious/notorious party.\n\nOur implementation is pretty straightforward.\n\nThe signature is a SHA-1 and SHA-256 HMAC hash of the `object_id` + `your client_id`, with the secret key as your `client_secret`.\n\nYou will be able to rebuild the signature the following way:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import hmac \\nfrom hashlib import sha1, sha256\\n\\nkey = 'your_client_secret'\\nraw = '{0}+{1}'.format(payload['_id']['$oid'],'your_client_id')\\n\\nhashed_sha1 = hmac.new(key, raw, sha1)\\nhashed_sha256 = hmac.new(key, raw, sha256)\\n\\n# The signature\\nprint hashed_sha1.hexdigest()\\nprint hashed_sha256.hexdigest()\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nPlease note that `raw` should look like this (with `+`): \n`\"563db3fb86c27307d925871f+e3f19e4bd4022c86e7f2\"`\n\nNot like this (without `+`):\n`\"563db3fb86c27307d925871fe3f19e4bd4022c86e7f2\"`.\n\nSince the sha1 signature is in hex, it should look like this: `bce964c20b0c36313d8f7cffc2ff4772d0c96750`.\n\nWe then take this signature and add it into the header of the request with name `X-Synapse-Signature` and `X-Synapse-Signature-Sha256`.\n\n## Webhook Format\nThe webhook always returns a user, node, or transaction object. These are the same as the objects returned by the API responses, with a couple exceptions:\n* The value of `id`s are objects storing an `$oid`, which is the object ID.\n* The value of `date`s are objects storing a `$date`.\n\nIf you wish to consume exactly the same responses as you get from the API, look under key `_rest`. If you also want to see who the object was updated by and what function was used to perform the update, look under `webhook_meta`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"documents\\\": [\\n    {\\n      \\\"permission_scope\\\": \\\"SEND|RECEIVE|1000|DAILY\\\",\\n      \\\"social_docs\\\": [\\n        {\\n          \\\"last_updated\\\": {\\n            \\\"$date\\\": 1498312100872\\n          },\\n          \\\"document_type\\\": \\\"FACEBOOK\\\",\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n          \\\"id\\\": \\\"8f314a6a53f36ee569455761e49a2a7fe790d251c5611c65255befdb303602b7\\\"\\n        },\\n        {\\n          \\\"last_updated\\\": {\\n            \\\"$date\\\": 1498312100872\\n          },\\n          \\\"document_type\\\": \\\"PHONE_NUMBER\\\",\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n          \\\"id\\\": \\\"fda60784d6375bc44edafaaeae149626c4c13dcb92e85a2a7a00eec2cdfd2b6f\\\"\\n        },\\n        {\\n          \\\"last_updated\\\": {\\n            \\\"$date\\\": 1498312100872\\n          },\\n          \\\"document_type\\\": \\\"EMAIL\\\",\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n          \\\"id\\\": \\\"2c45158f6431ca874bbe82f63d5905567854dde4d8b81539944e5779e5eee741\\\"\\n        },\\n        {\\n          \\\"last_updated\\\": {\\n            \\\"$date\\\": 1498312100872\\n          },\\n          \\\"document_type\\\": \\\"IP\\\",\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n          \\\"id\\\": \\\"28d9177b22c127d9a51d8903893864accf6e553ac326704a4c0d585eaad2516a\\\"\\n        }\\n      ],\\n      \\\"physical_docs\\\": [\\n        {\\n          \\\"last_updated\\\": {\\n            \\\"$date\\\": 1498312100869\\n          },\\n          \\\"document_type\\\": \\\"GOVT_ID\\\",\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n          \\\"id\\\": \\\"4d9f76fd95d00f501b6c9ab307948438b7f03ddd5b7d57300db8889cf5c44b9f\\\"\\n        }\\n      ],\\n      \\\"name\\\": \\\"Test User\\\",\\n      \\\"id\\\": \\\"2a4a5957a3a62aaac1a0dd0edcae96ea2cdee688ec6337b20745eed8869e3ac8\\\",\\n      \\\"virtual_docs\\\": [\\n        {\\n          \\\"last_updated\\\": {\\n            \\\"$date\\\": 1498312100867\\n          },\\n          \\\"document_type\\\": \\\"SSN\\\",\\n          \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n          \\\"id\\\": \\\"ee596c2896dddc19b76c07a184fe7d3cf5a04b8e94b9108190cac7890739017f\\\"\\n        }\\n      ]\\n    }\\n  ],\\n  \\\"phone_numbers\\\": [\\n    \\\"test:::at:::synapsepay.com\\\",\\n    \\\"901.111.1111\\\"\\n  ],\\n  \\\"doc_status\\\": {\\n    \\\"virtual_doc\\\": \\\"SUBMITTED|VALID\\\",\\n    \\\"physical_doc\\\": \\\"SUBMITTED|VALID\\\"\\n  },\\n  \\\"webhook_meta\\\": {\\n    \\\"updated_by\\\": \\\"BACKEND\\\",\\n    \\\"function\\\": \\\"USER|PATCH\\\"\\n  },\\n  \\\"permission\\\": \\\"SEND-AND-RECEIVE\\\",\\n  \\\"_rest\\\": {\\n    \\\"documents\\\": [\\n      {\\n        \\\"permission_scope\\\": \\\"SEND|RECEIVE|1000|DAILY\\\",\\n        \\\"social_docs\\\": [\\n          {\\n            \\\"last_updated\\\": 1498312100872,\\n            \\\"document_type\\\": \\\"FACEBOOK\\\",\\n            \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n            \\\"id\\\": \\\"8f314a6a53f36ee569455761e49a2a7fe790d251c5611c65255befdb303602b7\\\"\\n          },\\n          {\\n            \\\"last_updated\\\": 1498312100872,\\n            \\\"document_type\\\": \\\"PHONE_NUMBER\\\",\\n            \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n            \\\"id\\\": \\\"fda60784d6375bc44edafaaeae149626c4c13dcb92e85a2a7a00eec2cdfd2b6f\\\"\\n          },\\n          {\\n            \\\"last_updated\\\": 1498312100872,\\n            \\\"document_type\\\": \\\"EMAIL\\\",\\n            \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n            \\\"id\\\": \\\"2c45158f6431ca874bbe82f63d5905567854dde4d8b81539944e5779e5eee741\\\"\\n          },\\n          {\\n            \\\"last_updated\\\": 1498312100872,\\n            \\\"document_type\\\": \\\"IP\\\",\\n            \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n            \\\"id\\\": \\\"28d9177b22c127d9a51d8903893864accf6e553ac326704a4c0d585eaad2516a\\\"\\n          }\\n        ],\\n        \\\"physical_docs\\\": [\\n          {\\n            \\\"last_updated\\\": 1498312100869,\\n            \\\"document_type\\\": \\\"GOVT_ID\\\",\\n            \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n            \\\"id\\\": \\\"4d9f76fd95d00f501b6c9ab307948438b7f03ddd5b7d57300db8889cf5c44b9f\\\"\\n          }\\n        ],\\n        \\\"name\\\": \\\"Test User\\\",\\n        \\\"id\\\": \\\"2a4a5957a3a62aaac1a0dd0edcae96ea2cdee688ec6337b20745eed8869e3ac8\\\",\\n        \\\"virtual_docs\\\": [\\n          {\\n            \\\"last_updated\\\": 1498312100867,\\n            \\\"document_type\\\": \\\"SSN\\\",\\n            \\\"status\\\": \\\"SUBMITTED|VALID\\\",\\n            \\\"id\\\": \\\"ee596c2896dddc19b76c07a184fe7d3cf5a04b8e94b9108190cac7890739017f\\\"\\n          }\\n        ]\\n      }\\n    ],\\n    \\\"phone_numbers\\\": [\\n      \\\"test@synapsepay.com\\\",\\n      \\\"901.111.1111\\\"\\n    ],\\n    \\\"doc_status\\\": {\\n      \\\"virtual_doc\\\": \\\"SUBMITTED|VALID\\\",\\n      \\\"physical_doc\\\": \\\"SUBMITTED|VALID\\\"\\n    },\\n    \\\"permission\\\": \\\"SEND-AND-RECEIVE\\\",\\n    \\\"logins\\\": [\\n      {\\n        \\\"email\\\": \\\"test@synapsepay.com\\\",\\n        \\\"scope\\\": \\\"READ_AND_WRITE\\\"\\n      }\\n    ],\\n    \\\"is_hidden\\\": false,\\n    \\\"legal_names\\\": [\\n      \\\"Test User\\\"\\n    ],\\n    \\\"_id\\\": \\\"594e6da41acea2002e666987\\\",\\n    \\\"client\\\": {\\n      \\\"name\\\": \\\"SynapseFI\\\",\\n      \\\"id\\\": \\\"589acd9ecb3cd400fa75ac06\\\"\\n    },\\n    \\\"photos\\\": [],\\n    \\\"emails\\\": [],\\n    \\\"extra\\\": {\\n      \\\"extra_security\\\": false,\\n      \\\"is_business\\\": false,\\n      \\\"cip_tag\\\": 1,\\n      \\\"date_joined\\\": 1498312095716,\\n      \\\"public_note\\\": null,\\n      \\\"last_updated\\\": 1498312100856,\\n      \\\"supp_id\\\": \\\"122eddfgbeafrfvbbb\\\"\\n    }\\n  },\\n  \\\"logins\\\": [\\n    {\\n      \\\"email\\\": \\\"test@synapsepay.com\\\",\\n      \\\"scope\\\": \\\"READ_AND_WRITE\\\"\\n    }\\n  ],\\n  \\\"is_hidden\\\": false,\\n  \\\"legal_names\\\": [\\n    \\\"Test User\\\"\\n  ],\\n  \\\"_id\\\": {\\n    \\\"$oid\\\": \\\"594e6da41acea2002e666987\\\"\\n  },\\n  \\\"client\\\": {\\n    \\\"name\\\": \\\"SynapseFI\\\",\\n    \\\"id\\\": \\\"589acd9ecb3cd400fa75ac06\\\"\\n  },\\n  \\\"photos\\\": [],\\n  \\\"emails\\\": [],\\n  \\\"extra\\\": {\\n    \\\"extra_security\\\": false,\\n    \\\"is_business\\\": false,\\n    \\\"cip_tag\\\": 1,\\n    \\\"date_joined\\\": {\\n      \\\"$date\\\": 1498312095716\\n    },\\n    \\\"public_note\\\": null,\\n    \\\"last_updated\\\": {\\n      \\\"$date\\\": 1498312100856\\n    },\\n    \\\"supp_id\\\": \\\"122eddfgbeafrfvbbb\\\"\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"User\"\n    },\n    {\n      \"code\": \"{\\n  \\\"allowed\\\": \\\"CREDIT-AND-DEBIT\\\",\\n  \\\"timeline\\\": [\\n    {\\n      \\\"date\\\": {\\n        \\\"$date\\\": 1498312299937\\n      },\\n      \\\"note\\\": \\\"Node created.\\\"\\n    },\\n    {\\n      \\\"date\\\": {\\n        \\\"$date\\\": 1498312300555\\n      },\\n      \\\"note\\\": \\\"Micro deposits initiated.\\\"\\n    },\\n    {\\n      \\\"date\\\": {\\n        \\\"$date\\\": 1498312309798\\n      },\\n      \\\"note\\\": \\\"Correct Micro Deposit amounts attempted. Node's 'allowed' changed to 'CREDIT-AND-DEBIT'\\\"\\n    }\\n  ],\\n  \\\"is_active\\\": true,\\n  \\\"info\\\": {\\n    \\\"bank_long_name\\\": \\\"BANK OF AMERICA\\\",\\n    \\\"routing_num\\\": \\\"0017\\\",\\n    \\\"class\\\": \\\"CHECKING\\\",\\n    \\\"account_num\\\": \\\"2134\\\",\\n    \\\"bank_name\\\": \\\"BANK OF AMERICA\\\",\\n    \\\"balance\\\": {\\n      \\\"amount\\\": \\\"0.00\\\",\\n      \\\"currency\\\": \\\"USD\\\"\\n    },\\n    \\\"address\\\": \\\"8001 VILLA PARK DRIVE, HENRICO, VA, US\\\",\\n    \\\"match_info\\\": {\\n      \\\"email_match\\\": \\\"not_found\\\",\\n      \\\"phonenumber_match\\\": \\\"not_found\\\",\\n      \\\"name_match\\\": \\\"not_found\\\"\\n    },\\n    \\\"type\\\": \\\"PERSONAL\\\",\\n    \\\"name_on_account\\\": \\\" \\\",\\n    \\\"nickname\\\": \\\"Fake Account\\\"\\n  },\\n  \\\"webhook_meta\\\": {\\n    \\\"function\\\": \\\"NODE|PATCH\\\",\\n    \\\"updated_by\\\": \\\"SELF\\\"\\n  },\\n  \\\"_rest\\\": {\\n    \\\"allowed\\\": \\\"CREDIT-AND-DEBIT\\\",\\n    \\\"timeline\\\": [\\n      {\\n        \\\"date\\\": 1498312299937,\\n        \\\"note\\\": \\\"Node created.\\\"\\n      },\\n      {\\n        \\\"date\\\": 1498312300555,\\n        \\\"note\\\": \\\"Micro deposits initiated.\\\"\\n      },\\n      {\\n        \\\"date\\\": 1498312309798,\\n        \\\"note\\\": \\\"Correct Micro Deposit amounts attempted. Node's 'allowed' changed to 'CREDIT-AND-DEBIT'\\\"\\n      }\\n    ],\\n    \\\"is_active\\\": true,\\n    \\\"info\\\": {\\n      \\\"bank_long_name\\\": \\\"BANK OF AMERICA\\\",\\n      \\\"routing_num\\\": \\\"0017\\\",\\n      \\\"class\\\": \\\"CHECKING\\\",\\n      \\\"account_num\\\": \\\"2134\\\",\\n      \\\"bank_name\\\": \\\"BANK OF AMERICA\\\",\\n      \\\"balance\\\": {\\n        \\\"amount\\\": \\\"0.00\\\",\\n        \\\"currency\\\": \\\"USD\\\"\\n      },\\n      \\\"address\\\": \\\"8001 VILLA PARK DRIVE, HENRICO, VA, US\\\",\\n      \\\"match_info\\\": {\\n        \\\"email_match\\\": \\\"not_found\\\",\\n        \\\"phonenumber_match\\\": \\\"not_found\\\",\\n        \\\"name_match\\\": \\\"not_found\\\"\\n      },\\n      \\\"type\\\": \\\"PERSONAL\\\",\\n      \\\"name_on_account\\\": \\\" \\\",\\n      \\\"nickname\\\": \\\"Fake Account\\\"\\n    },\\n    \\\"_id\\\": \\\"594e6e6c12e17a002f2e39e4\\\",\\n    \\\"client\\\": {\\n      \\\"id\\\": \\\"589acd9ecb3cd400fa75ac06\\\",\\n      \\\"name\\\": \\\"SynapseFI\\\"\\n    },\\n    \\\"type\\\": \\\"ACH-US\\\",\\n    \\\"extra\\\": {\\n      \\\"supp_id\\\": \\\"ABC124\\\"\\n    },\\n    \\\"user_id\\\": \\\"594e6da41acea2002e666987\\\"\\n  },\\n  \\\"_id\\\": {\\n    \\\"$oid\\\": \\\"594e6e6c12e17a002f2e39e4\\\"\\n  },\\n  \\\"client\\\": {\\n    \\\"id\\\": \\\"589acd9ecb3cd400fa75ac06\\\",\\n    \\\"name\\\": \\\"SynapseFI\\\"\\n  },\\n  \\\"type\\\": \\\"ACH-US\\\",\\n  \\\"extra\\\": {\\n    \\\"supp_id\\\": \\\"ABC124\\\"\\n  },\\n  \\\"user_id\\\": \\\"594e6da41acea2002e666987\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Node\"\n    },\n    {\n      \"code\": \"{\\n  \\\"timeline\\\": [\\n    {\\n      \\\"status\\\": \\\"CREATED\\\",\\n      \\\"note\\\": \\\"Transaction Created.\\\",\\n      \\\"status_id\\\": \\\"1\\\",\\n      \\\"date\\\": {\\n        \\\"$date\\\": 1498312348440\\n      }\\n    }\\n  ],\\n  \\\"webhook_meta\\\": {\\n    \\\"updated_by\\\": \\\"BACKEND\\\",\\n    \\\"function\\\": \\\"TRAN|PATCH\\\"\\n  },\\n  \\\"fees\\\": [\\n    {\\n      \\\"fee\\\": 0.2,\\n      \\\"note\\\": \\\"Synapse Facilitator Fee\\\",\\n      \\\"to\\\": {\\n        \\\"id\\\": {\\n          \\\"$oid\\\": \\\"55b3f8c686c2732b4c4e9df6\\\"\\n        }\\n      }\\n    }\\n  ],\\n  \\\"amount\\\": {\\n    \\\"currency\\\": \\\"USD\\\",\\n    \\\"amount\\\": 20.1\\n  },\\n  \\\"_rest\\\": {\\n    \\\"timeline\\\": [\\n      {\\n        \\\"status\\\": \\\"CREATED\\\",\\n        \\\"note\\\": \\\"Transaction Created.\\\",\\n        \\\"status_id\\\": \\\"1\\\",\\n        \\\"date\\\": 1498312348440\\n      }\\n    ],\\n    \\\"fees\\\": [\\n      {\\n        \\\"fee\\\": 0.2,\\n        \\\"note\\\": \\\"Synapse Facilitator Fee\\\",\\n        \\\"to\\\": {\\n          \\\"id\\\": \\\"55b3f8c686c2732b4c4e9df6\\\"\\n        }\\n      }\\n    ],\\n    \\\"_v\\\": 2,\\n    \\\"from\\\": {\\n      \\\"user\\\": {\\n        \\\"legal_names\\\": [\\n          \\\"Test User\\\"\\n        ],\\n        \\\"_id\\\": \\\"594e6da41acea2002e666987\\\"\\n      },\\n      \\\"type\\\": \\\"ACH-US\\\",\\n      \\\"nickname\\\": \\\"Fake Account\\\",\\n      \\\"id\\\": \\\"594e6e6c12e17a002f2e39e4\\\"\\n    },\\n    \\\"_id\\\": \\\"594e6e9c4599e8002fe62e3c\\\",\\n    \\\"client\\\": {\\n      \\\"name\\\": \\\"SynapseFI\\\",\\n      \\\"id\\\": \\\"589acd9ecb3cd400fa75ac06\\\"\\n    },\\n    \\\"to\\\": {\\n      \\\"user\\\": {\\n        \\\"legal_names\\\": [\\n          \\\"Test User\\\"\\n        ],\\n        \\\"_id\\\": \\\"594e6da41acea2002e666987\\\"\\n      },\\n      \\\"type\\\": \\\"ACH-US\\\",\\n      \\\"nickname\\\": \\\"Fake Account\\\",\\n      \\\"id\\\": \\\"594e6e6c12e17a002f2e39e4\\\"\\n    },\\n    \\\"recent_status\\\": {\\n      \\\"status\\\": \\\"CREATED\\\",\\n      \\\"note\\\": \\\"Transaction Created.\\\",\\n      \\\"status_id\\\": \\\"1\\\",\\n      \\\"date\\\": 1498312348440\\n    },\\n    \\\"extra\\\": {\\n      \\\"note\\\": \\\"Test transaction\\\",\\n      \\\"created_on\\\": 1498312348440,\\n      \\\"process_on\\\": 1498312348440,\\n      \\\"supp_id\\\": \\\"1122444\\\",\\n      \\\"ip\\\": \\\"192.168.0.1\\\",\\n      \\\"latlon\\\": \\\"0,0\\\"\\n    },\\n    \\\"amount\\\": {\\n      \\\"currency\\\": \\\"USD\\\",\\n      \\\"amount\\\": 20.1\\n    }\\n  },\\n  \\\"extra\\\": {\\n    \\\"note\\\": \\\"Test transaction\\\",\\n    \\\"created_on\\\": {\\n      \\\"$date\\\": 1498312348440\\n    },\\n    \\\"process_on\\\": {\\n      \\\"$date\\\": 1498312348440\\n    },\\n    \\\"supp_id\\\": \\\"1122444\\\",\\n    \\\"ip\\\": \\\"192.168.0.1\\\",\\n    \\\"latlon\\\": \\\"0,0\\\"\\n  },\\n  \\\"_v\\\": 2,\\n  \\\"_id\\\": {\\n    \\\"$oid\\\": \\\"594e6e9c4599e8002fe62e3c\\\"\\n  },\\n  \\\"client\\\": {\\n    \\\"name\\\": \\\"SynapseFI\\\",\\n    \\\"id\\\": \\\"589acd9ecb3cd400fa75ac06\\\"\\n  },\\n  \\\"to\\\": {\\n    \\\"user\\\": {\\n      \\\"legal_names\\\": [\\n        \\\"Test User\\\"\\n      ],\\n      \\\"_id\\\": {\\n        \\\"$oid\\\": \\\"594e6da41acea2002e666987\\\"\\n      }\\n    },\\n    \\\"type\\\": \\\"ACH-US\\\",\\n    \\\"nickname\\\": \\\"Fake Account\\\",\\n    \\\"id\\\": {\\n      \\\"$oid\\\": \\\"594e6e6c12e17a002f2e39e4\\\"\\n    }\\n  },\\n  \\\"recent_status\\\": {\\n    \\\"status\\\": \\\"CREATED\\\",\\n    \\\"note\\\": \\\"Transaction Created.\\\",\\n    \\\"status_id\\\": \\\"1\\\",\\n    \\\"date\\\": {\\n      \\\"$date\\\": 1498312348440\\n    }\\n  },\\n  \\\"from\\\": {\\n    \\\"user\\\": {\\n      \\\"legal_names\\\": [\\n        \\\"Test User\\\"\\n      ],\\n      \\\"_id\\\": {\\n        \\\"$oid\\\": \\\"594e6da41acea2002e666987\\\"\\n      }\\n    },\\n    \\\"type\\\": \\\"ACH-US\\\",\\n    \\\"nickname\\\": \\\"Fake Account\\\",\\n    \\\"id\\\": {\\n      \\\"$oid\\\": \\\"594e6e6c12e17a002f2e39e4\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Transaction\"\n    }\n  ]\n}\n[/block]\n## Webhook Logistics\n\nIf for some reason we fail to deliver a webhook to you, we will continue trying to send the request every 10 minutes until we are successful in delivering the webhook, up to 24 hours. After that, we will log the webhook and make it available for viewing on our dashboard. That way, even if we fail to deliver the request, you can still access the original request and the reason as to why the webhook failed.\n\nA webhook delivery is considered a failure if your server **does not** respond with one of the following HTTP codes: 200, 204, 400, 404, 405.","excerpt":"","slug":"subscriptions","type":"basic","title":"Subscriptions"}
Subscription resources are generic user classes that stores a gateway's webhook preferences. ## Subscription Object [block:html] { "html": "<div class=\"api-manager\"><div class=\"param-table\"><div class=\"table\"><div class=\"tr\"><div class=\"td param\"><strong>_id<span class=\"colon\">:</span></strong></div><div class=\"td\"><strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Object ID of a subscription object</p>\n</div></div></div><div class=\"tr\"><div class=\"td param\"><strong><span class=\"text-muted\">_links.self.</span>href<span class=\"colon\">:</span></strong></div><div class=\"td\"><strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>HAL style link for the subscription object</p>\n</div></div></div><div class=\"tr\"><div class=\"td param\"><strong>client_id<span class=\"colon\">:</span></strong></div><div class=\"td\"><strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>ID of the client who the subscription belongs to</p>\n</div></div></div><div class=\"tr\"><div class=\"td param\"><strong>scope<span class=\"colon\">:</span></strong></div><div class=\"td\"><strong class=\"param-type\">array of strings</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Scope of the webhook subscription</p>\n</div></div></div><div class=\"tr\"><div class=\"td param\"><strong>url<span class=\"colon\">:</span></strong></div><div class=\"td\"><strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Webhook url for this subscription</p>\n</div></div></div><div class=\"tr\"><div class=\"td param\"><strong>is_active<span class=\"colon\">:</span></strong></div><div class=\"td\"><strong class=\"param-type\">boolean</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>If the subscription is active or not</p>\n</div></div></div></div></div></div>" } [/block] ## Scope Syntax Scope tells us when this webhook should be triggered. Following are the ways you can supply scope for subscriptions. [block:parameters] { "data": { "h-0": "Scope", "h-1": "Effect", "0-0": "USERS|POST", "0-1": "Whenever a user is created with your gateway credentials, you will receive a webhook.", "2-0": "NODES|POST", "2-1": "Whenever a node is created for a user registered with your gateway, you will receive a webhook.", "4-0": "TRANS|POST", "4-1": "Whenever a transaction is created with your gateway credentials, you will receive a webhook.", "1-0": "USER|PATCH", "1-1": "Whenever a user linked to your gateway is updated, you will receive a webhook.", "3-0": "NODE|PATCH", "3-1": "Whenever a node linked to a registered user is updated, you will receive a webhook.", "5-0": "TRAN|PATCH", "5-1": "Whenever a transaction created with your gateway credentials is updated, you will receive a webhook." }, "cols": 2, "rows": 6 } [/block] ## HMAC For Web hooks Every webhook will be signed with HMAC. If you do not know what HMAC is --- it is a protocol that helps you judge the authenticity of the received message. This comes in handy when you want to quickly find out whether the web hook was sent by SynapsePay or a malicious/notorious party. Our implementation is pretty straightforward. The signature is a SHA-1 and SHA-256 HMAC hash of the `object_id` + `your client_id`, with the secret key as your `client_secret`. You will be able to rebuild the signature the following way: [block:code] { "codes": [ { "code": "import hmac \nfrom hashlib import sha1, sha256\n\nkey = 'your_client_secret'\nraw = '{0}+{1}'.format(payload['_id']['$oid'],'your_client_id')\n\nhashed_sha1 = hmac.new(key, raw, sha1)\nhashed_sha256 = hmac.new(key, raw, sha256)\n\n# The signature\nprint hashed_sha1.hexdigest()\nprint hashed_sha256.hexdigest()", "language": "python" } ] } [/block] Please note that `raw` should look like this (with `+`): `"563db3fb86c27307d925871f+e3f19e4bd4022c86e7f2"` Not like this (without `+`): `"563db3fb86c27307d925871fe3f19e4bd4022c86e7f2"`. Since the sha1 signature is in hex, it should look like this: `bce964c20b0c36313d8f7cffc2ff4772d0c96750`. We then take this signature and add it into the header of the request with name `X-Synapse-Signature` and `X-Synapse-Signature-Sha256`. ## Webhook Format The webhook always returns a user, node, or transaction object. These are the same as the objects returned by the API responses, with a couple exceptions: * The value of `id`s are objects storing an `$oid`, which is the object ID. * The value of `date`s are objects storing a `$date`. If you wish to consume exactly the same responses as you get from the API, look under key `_rest`. If you also want to see who the object was updated by and what function was used to perform the update, look under `webhook_meta`. [block:code] { "codes": [ { "code": "{\n \"documents\": [\n {\n \"permission_scope\": \"SEND|RECEIVE|1000|DAILY\",\n \"social_docs\": [\n {\n \"last_updated\": {\n \"$date\": 1498312100872\n },\n \"document_type\": \"FACEBOOK\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"8f314a6a53f36ee569455761e49a2a7fe790d251c5611c65255befdb303602b7\"\n },\n {\n \"last_updated\": {\n \"$date\": 1498312100872\n },\n \"document_type\": \"PHONE_NUMBER\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"fda60784d6375bc44edafaaeae149626c4c13dcb92e85a2a7a00eec2cdfd2b6f\"\n },\n {\n \"last_updated\": {\n \"$date\": 1498312100872\n },\n \"document_type\": \"EMAIL\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"2c45158f6431ca874bbe82f63d5905567854dde4d8b81539944e5779e5eee741\"\n },\n {\n \"last_updated\": {\n \"$date\": 1498312100872\n },\n \"document_type\": \"IP\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"28d9177b22c127d9a51d8903893864accf6e553ac326704a4c0d585eaad2516a\"\n }\n ],\n \"physical_docs\": [\n {\n \"last_updated\": {\n \"$date\": 1498312100869\n },\n \"document_type\": \"GOVT_ID\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"4d9f76fd95d00f501b6c9ab307948438b7f03ddd5b7d57300db8889cf5c44b9f\"\n }\n ],\n \"name\": \"Test User\",\n \"id\": \"2a4a5957a3a62aaac1a0dd0edcae96ea2cdee688ec6337b20745eed8869e3ac8\",\n \"virtual_docs\": [\n {\n \"last_updated\": {\n \"$date\": 1498312100867\n },\n \"document_type\": \"SSN\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"ee596c2896dddc19b76c07a184fe7d3cf5a04b8e94b9108190cac7890739017f\"\n }\n ]\n }\n ],\n \"phone_numbers\": [\n \"test@synapsepay.com\",\n \"901.111.1111\"\n ],\n \"doc_status\": {\n \"virtual_doc\": \"SUBMITTED|VALID\",\n \"physical_doc\": \"SUBMITTED|VALID\"\n },\n \"webhook_meta\": {\n \"updated_by\": \"BACKEND\",\n \"function\": \"USER|PATCH\"\n },\n \"permission\": \"SEND-AND-RECEIVE\",\n \"_rest\": {\n \"documents\": [\n {\n \"permission_scope\": \"SEND|RECEIVE|1000|DAILY\",\n \"social_docs\": [\n {\n \"last_updated\": 1498312100872,\n \"document_type\": \"FACEBOOK\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"8f314a6a53f36ee569455761e49a2a7fe790d251c5611c65255befdb303602b7\"\n },\n {\n \"last_updated\": 1498312100872,\n \"document_type\": \"PHONE_NUMBER\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"fda60784d6375bc44edafaaeae149626c4c13dcb92e85a2a7a00eec2cdfd2b6f\"\n },\n {\n \"last_updated\": 1498312100872,\n \"document_type\": \"EMAIL\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"2c45158f6431ca874bbe82f63d5905567854dde4d8b81539944e5779e5eee741\"\n },\n {\n \"last_updated\": 1498312100872,\n \"document_type\": \"IP\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"28d9177b22c127d9a51d8903893864accf6e553ac326704a4c0d585eaad2516a\"\n }\n ],\n \"physical_docs\": [\n {\n \"last_updated\": 1498312100869,\n \"document_type\": \"GOVT_ID\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"4d9f76fd95d00f501b6c9ab307948438b7f03ddd5b7d57300db8889cf5c44b9f\"\n }\n ],\n \"name\": \"Test User\",\n \"id\": \"2a4a5957a3a62aaac1a0dd0edcae96ea2cdee688ec6337b20745eed8869e3ac8\",\n \"virtual_docs\": [\n {\n \"last_updated\": 1498312100867,\n \"document_type\": \"SSN\",\n \"status\": \"SUBMITTED|VALID\",\n \"id\": \"ee596c2896dddc19b76c07a184fe7d3cf5a04b8e94b9108190cac7890739017f\"\n }\n ]\n }\n ],\n \"phone_numbers\": [\n \"test@synapsepay.com\",\n \"901.111.1111\"\n ],\n \"doc_status\": {\n \"virtual_doc\": \"SUBMITTED|VALID\",\n \"physical_doc\": \"SUBMITTED|VALID\"\n },\n \"permission\": \"SEND-AND-RECEIVE\",\n \"logins\": [\n {\n \"email\": \"test@synapsepay.com\",\n \"scope\": \"READ_AND_WRITE\"\n }\n ],\n \"is_hidden\": false,\n \"legal_names\": [\n \"Test User\"\n ],\n \"_id\": \"594e6da41acea2002e666987\",\n \"client\": {\n \"name\": \"SynapseFI\",\n \"id\": \"589acd9ecb3cd400fa75ac06\"\n },\n \"photos\": [],\n \"emails\": [],\n \"extra\": {\n \"extra_security\": false,\n \"is_business\": false,\n \"cip_tag\": 1,\n \"date_joined\": 1498312095716,\n \"public_note\": null,\n \"last_updated\": 1498312100856,\n \"supp_id\": \"122eddfgbeafrfvbbb\"\n }\n },\n \"logins\": [\n {\n \"email\": \"test@synapsepay.com\",\n \"scope\": \"READ_AND_WRITE\"\n }\n ],\n \"is_hidden\": false,\n \"legal_names\": [\n \"Test User\"\n ],\n \"_id\": {\n \"$oid\": \"594e6da41acea2002e666987\"\n },\n \"client\": {\n \"name\": \"SynapseFI\",\n \"id\": \"589acd9ecb3cd400fa75ac06\"\n },\n \"photos\": [],\n \"emails\": [],\n \"extra\": {\n \"extra_security\": false,\n \"is_business\": false,\n \"cip_tag\": 1,\n \"date_joined\": {\n \"$date\": 1498312095716\n },\n \"public_note\": null,\n \"last_updated\": {\n \"$date\": 1498312100856\n },\n \"supp_id\": \"122eddfgbeafrfvbbb\"\n }\n}", "language": "json", "name": "User" }, { "code": "{\n \"allowed\": \"CREDIT-AND-DEBIT\",\n \"timeline\": [\n {\n \"date\": {\n \"$date\": 1498312299937\n },\n \"note\": \"Node created.\"\n },\n {\n \"date\": {\n \"$date\": 1498312300555\n },\n \"note\": \"Micro deposits initiated.\"\n },\n {\n \"date\": {\n \"$date\": 1498312309798\n },\n \"note\": \"Correct Micro Deposit amounts attempted. Node's 'allowed' changed to 'CREDIT-AND-DEBIT'\"\n }\n ],\n \"is_active\": true,\n \"info\": {\n \"bank_long_name\": \"BANK OF AMERICA\",\n \"routing_num\": \"0017\",\n \"class\": \"CHECKING\",\n \"account_num\": \"2134\",\n \"bank_name\": \"BANK OF AMERICA\",\n \"balance\": {\n \"amount\": \"0.00\",\n \"currency\": \"USD\"\n },\n \"address\": \"8001 VILLA PARK DRIVE, HENRICO, VA, US\",\n \"match_info\": {\n \"email_match\": \"not_found\",\n \"phonenumber_match\": \"not_found\",\n \"name_match\": \"not_found\"\n },\n \"type\": \"PERSONAL\",\n \"name_on_account\": \" \",\n \"nickname\": \"Fake Account\"\n },\n \"webhook_meta\": {\n \"function\": \"NODE|PATCH\",\n \"updated_by\": \"SELF\"\n },\n \"_rest\": {\n \"allowed\": \"CREDIT-AND-DEBIT\",\n \"timeline\": [\n {\n \"date\": 1498312299937,\n \"note\": \"Node created.\"\n },\n {\n \"date\": 1498312300555,\n \"note\": \"Micro deposits initiated.\"\n },\n {\n \"date\": 1498312309798,\n \"note\": \"Correct Micro Deposit amounts attempted. Node's 'allowed' changed to 'CREDIT-AND-DEBIT'\"\n }\n ],\n \"is_active\": true,\n \"info\": {\n \"bank_long_name\": \"BANK OF AMERICA\",\n \"routing_num\": \"0017\",\n \"class\": \"CHECKING\",\n \"account_num\": \"2134\",\n \"bank_name\": \"BANK OF AMERICA\",\n \"balance\": {\n \"amount\": \"0.00\",\n \"currency\": \"USD\"\n },\n \"address\": \"8001 VILLA PARK DRIVE, HENRICO, VA, US\",\n \"match_info\": {\n \"email_match\": \"not_found\",\n \"phonenumber_match\": \"not_found\",\n \"name_match\": \"not_found\"\n },\n \"type\": \"PERSONAL\",\n \"name_on_account\": \" \",\n \"nickname\": \"Fake Account\"\n },\n \"_id\": \"594e6e6c12e17a002f2e39e4\",\n \"client\": {\n \"id\": \"589acd9ecb3cd400fa75ac06\",\n \"name\": \"SynapseFI\"\n },\n \"type\": \"ACH-US\",\n \"extra\": {\n \"supp_id\": \"ABC124\"\n },\n \"user_id\": \"594e6da41acea2002e666987\"\n },\n \"_id\": {\n \"$oid\": \"594e6e6c12e17a002f2e39e4\"\n },\n \"client\": {\n \"id\": \"589acd9ecb3cd400fa75ac06\",\n \"name\": \"SynapseFI\"\n },\n \"type\": \"ACH-US\",\n \"extra\": {\n \"supp_id\": \"ABC124\"\n },\n \"user_id\": \"594e6da41acea2002e666987\"\n}", "language": "json", "name": "Node" }, { "code": "{\n \"timeline\": [\n {\n \"status\": \"CREATED\",\n \"note\": \"Transaction Created.\",\n \"status_id\": \"1\",\n \"date\": {\n \"$date\": 1498312348440\n }\n }\n ],\n \"webhook_meta\": {\n \"updated_by\": \"BACKEND\",\n \"function\": \"TRAN|PATCH\"\n },\n \"fees\": [\n {\n \"fee\": 0.2,\n \"note\": \"Synapse Facilitator Fee\",\n \"to\": {\n \"id\": {\n \"$oid\": \"55b3f8c686c2732b4c4e9df6\"\n }\n }\n }\n ],\n \"amount\": {\n \"currency\": \"USD\",\n \"amount\": 20.1\n },\n \"_rest\": {\n \"timeline\": [\n {\n \"status\": \"CREATED\",\n \"note\": \"Transaction Created.\",\n \"status_id\": \"1\",\n \"date\": 1498312348440\n }\n ],\n \"fees\": [\n {\n \"fee\": 0.2,\n \"note\": \"Synapse Facilitator Fee\",\n \"to\": {\n \"id\": \"55b3f8c686c2732b4c4e9df6\"\n }\n }\n ],\n \"_v\": 2,\n \"from\": {\n \"user\": {\n \"legal_names\": [\n \"Test User\"\n ],\n \"_id\": \"594e6da41acea2002e666987\"\n },\n \"type\": \"ACH-US\",\n \"nickname\": \"Fake Account\",\n \"id\": \"594e6e6c12e17a002f2e39e4\"\n },\n \"_id\": \"594e6e9c4599e8002fe62e3c\",\n \"client\": {\n \"name\": \"SynapseFI\",\n \"id\": \"589acd9ecb3cd400fa75ac06\"\n },\n \"to\": {\n \"user\": {\n \"legal_names\": [\n \"Test User\"\n ],\n \"_id\": \"594e6da41acea2002e666987\"\n },\n \"type\": \"ACH-US\",\n \"nickname\": \"Fake Account\",\n \"id\": \"594e6e6c12e17a002f2e39e4\"\n },\n \"recent_status\": {\n \"status\": \"CREATED\",\n \"note\": \"Transaction Created.\",\n \"status_id\": \"1\",\n \"date\": 1498312348440\n },\n \"extra\": {\n \"note\": \"Test transaction\",\n \"created_on\": 1498312348440,\n \"process_on\": 1498312348440,\n \"supp_id\": \"1122444\",\n \"ip\": \"192.168.0.1\",\n \"latlon\": \"0,0\"\n },\n \"amount\": {\n \"currency\": \"USD\",\n \"amount\": 20.1\n }\n },\n \"extra\": {\n \"note\": \"Test transaction\",\n \"created_on\": {\n \"$date\": 1498312348440\n },\n \"process_on\": {\n \"$date\": 1498312348440\n },\n \"supp_id\": \"1122444\",\n \"ip\": \"192.168.0.1\",\n \"latlon\": \"0,0\"\n },\n \"_v\": 2,\n \"_id\": {\n \"$oid\": \"594e6e9c4599e8002fe62e3c\"\n },\n \"client\": {\n \"name\": \"SynapseFI\",\n \"id\": \"589acd9ecb3cd400fa75ac06\"\n },\n \"to\": {\n \"user\": {\n \"legal_names\": [\n \"Test User\"\n ],\n \"_id\": {\n \"$oid\": \"594e6da41acea2002e666987\"\n }\n },\n \"type\": \"ACH-US\",\n \"nickname\": \"Fake Account\",\n \"id\": {\n \"$oid\": \"594e6e6c12e17a002f2e39e4\"\n }\n },\n \"recent_status\": {\n \"status\": \"CREATED\",\n \"note\": \"Transaction Created.\",\n \"status_id\": \"1\",\n \"date\": {\n \"$date\": 1498312348440\n }\n },\n \"from\": {\n \"user\": {\n \"legal_names\": [\n \"Test User\"\n ],\n \"_id\": {\n \"$oid\": \"594e6da41acea2002e666987\"\n }\n },\n \"type\": \"ACH-US\",\n \"nickname\": \"Fake Account\",\n \"id\": {\n \"$oid\": \"594e6e6c12e17a002f2e39e4\"\n }\n }\n}", "language": "json", "name": "Transaction" } ] } [/block] ## Webhook Logistics If for some reason we fail to deliver a webhook to you, we will continue trying to send the request every 10 minutes until we are successful in delivering the webhook, up to 24 hours. After that, we will log the webhook and make it available for viewing on our dashboard. That way, even if we fail to deliver the request, you can still access the original request and the reason as to why the webhook failed. A webhook delivery is considered a failure if your server **does not** respond with one of the following HTTP codes: 200, 204, 400, 404, 405.