title: AWS Cognito add custom attribute
body: <p>Hey everyone so I a have a predicament here. I am trying to add a custom attribute to my AWS cognito user but when ever I do I get the following error: <code>{"message":"Invalid user attributes: custom:expiration_date: Attribute does not exist in the schema.\n","code":"InvalidParameterException","time":"2019-10-08T20:29:26.050Z","requestId":"e088a624-95a3-4d42-a8d2-e2029e41f890","statusCode":400,"retryable":false,"retryDelay":30.119738164581644}</code> However I have the following attribute defined in my AWS user pool as shown in the screenshot.  <a href="https://i.stack.imgur.com/ZRQok.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZRQok.png" alt="enter image description here"></a></p>
  
  <p>I have the following code to update the attribute but with no success. </p>
  
  <pre><code>router.put("/set-user-expiration-date", async (req, res) =&gt; {
    if (res.locals.user &amp;&amp; res.locals.user.role === "admin") {
      try {
        const date = req.body.expirationDate.toString();
        const params = {
          UserAttributes: [{ Name: "custom:expiration_date", Value: date }],
          UserPoolId: process.env.AWS_COGNITO_USER_POOL_ID,
          Username: req.body.username
        };
        await cognito.adminUpdateUserAttributes(params).promise();
        res.send("Successfully updated.");
      } catch (error) {
        res.send(error);
      }
    } else {
      res.status(401).send("No admin rights");
    }
  });
  </code></pre>
  
  <p>Any help here would be great. Thanks :) </p>