Find your content:

Search form

You are here

Can the Context User on an Email Service be an API-Only User?


The title kind of says it all: Can the Context User on an Email Service be an API-Only User?

I found this note in the online documentation:

Set Context User – this specifies the context under which the Apex class will run. It defaults to you, but you’re free to pick another user from your organization.

but it doesn't indicate whether it can be API-Only.

UPDATE: When I say "API Only", I'm not referring to a different license type or a different set up CRUD permissions; I'm referring to whether the user has the following User Permission enabled (see

API Only User - Access Salesforce only through a Salesforce API.

Attribution to: Benj

Possible Suggestion/Solution #1

I tested it, and if you refer to the type of user license: Salesforce Platform - than yes, I was able to set the context user of an email address as such.

EDIT: Created an API only profile. Set Test user to be of that profile. no problem on setting email services on the user.

As previously answered, object permissions will also play role in this, so you need to make sure the correct settings are applied.

Attribution to: Saariko

Possible Suggestion/Solution #2

It can be an API only profile, but you also need to check that it has the correct accesss to any objects that the class uses.

e.g. If it requires access to a specific object, in that case you would need to make sure the user's profile also has the correct CRUD permission on that object.

Attribution to: PepeFloyd
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content