API only users cannot login and choose 'Reset my security token'. Right now, in my company, we select a System Administrator profile for users, log in for the first time, choose 'Reset my security token', then change the profile to a custom profile which has API only enabled.

The other way of doing it is, modifying the profile to not have API only user checked initially and then turn it on once the security token is received.

Is there a recommend way to do this? Is there an option to force the security token to be sent when the user is created with a profile which has API user enabled?

  • I am unsure what you want here, Are you asking if there is a way to not use security tokens / turn them off? If that is what you are asking yes, you can change your Login IP Range. This will let you Login and do API calls without needing the token. You can also make it so System Admin has API Only turned on when you deploy your code – TimChadwick Nov 25 '13 at 14:49
  • @TimChadwick I'm asking how do I access the 'Reset Security Token' option for users with API Only on their profiles. (That's so much simpler!) – Vid L Nov 27 '13 at 12:46

In the UI - change API only user profile to another non-api only user profile. Log in, reset security token. The IP range(s) on the profile assigned to the non-API User must allow your IP or you will not see the 'Reset Security Token' option on the User record.


You could try changing the users password.

From Security and the API (my emphasis):

Users can obtain their security token by changing their password or resetting their security token via the Salesforce user interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the email address on the user’s Salesforce record. The security token is valid until a user resets their security token, changes their password, or has their password reset.

One way to change the password would be to use the setPassword() Partner API method from another valid API user.

UPDATE: It appears that the setPassword() method is insufficient to trigger sending the security token. Instead, see Dewid's answer.

Additionally, consider voting for the idea: Give the ability to change API Only User security token

  • 3
    A security token is sent on password resets only if it's received the first time through the UI option. Is that not so? – Vid L Dec 18 '13 at 18:00
  1. Use the Log In as Another User feature to log as the 'API Only' user


  1. Reset the security token while logged in as the 'API Only' user



We are following the below steps. 1. Created a Custom Profile named 'API only' (API permission is enable). 2. Resetting the password from the UI or you may use Apex script if don't want to send any email to the API only user. 3. Use 'Login As' button from the User created above --> Go to My Settings from the User icon. 4. Reset the Security Token, an email will be sent to the User email ID. 5. log off.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.